set button size dynamically
-
how can i set button size according to text size dynamically, means in run time text of button is changed using setwindowtext() method but size of button remain static either text is small or larger so how to fix it, pls help
-
use
SetWindowPos()
orMoveWindow()
function to resize the button. To find out how much length a text takes, use theCDC::GetTextExtent()
function orCDC::DrawText()
function. -
thanks for da reply but will u plz send me code using these methods as never used before
ani_ikram wrote:
u plz send me code using these methods as never used before
So you dont want to learn vc++? Check the MSDN for the help of each function, do some sample and ask us if you face some problem while using that functions. Those functions are really easy to understand. Give a try..
-
thanks for da reply but will u plz send me code using these methods as never used before
Its not hard you need to a handle to your button.