How do you get the size of a control?? Window or Static?
I need width and height of control...
Size Of Control?
Re: Size Of Control?
Under Windows, it's either GetWindowRect or GetClientRect, depending on your needs.
Re: Size Of Control?
Using the rectangle
Code: Select all
#include "windows.bi"
dim as msg message
var main= CreateWindowEx( 0, "#32770", "stretch me", WS_OVERLAPPEDWINDOW Or WS_VISIBLE , 100, 0, 800, 600, 0, 0, 0, 0 )
var box=CreateWindowEx( 0, "static", "" , WS_Border or WS_VISIBLE Or WS_CHILD , 10 , 10 , 100 , 100 , main, 0, 0, 0 )
While GetMessage( @message, null, 0, 0 )
TranslateMessage( @message )
DispatchMessage( @message )
Select Case message.hwnd
Case main
Select Case message.message
Case 273 : end
case else
Dim As rect r
getwindowrect(Main,@r)
var wide=r.right-r.left
var high=r.bottom-r.top
var s="Main size ="+chr(13,10)+ str(wide)+" by "+str(high)+chr(13,10,13,10,13,10)
'do the label
getwindowrect(box,@r)
wide=r.right-r.left
high=r.bottom-r.top
s+="box size ="+chr(13,10)+ str(wide)+" by "+str(high)+chr(13,10)
setwindowtext(box,s)
End Select
End Select
Wend
Re: Size Of Control?
@Dodicat
Thanks for the code and info....
Thanks for the code and info....
Re: Size Of Control?
You are welcome, Albert.
Re: Size Of Control?
Thanks jj2007!