Question help with relocating and resizing controls in a SCROLLABLE windows form

mukulmukul

Member
Joined
Jun 21, 2009
Messages
10
Programming Experience
Beginner
hi,
i have created a windows form that has some labels, lines , buttons and i have enabled autoscroll property to true.

i am having trouble with relocating and resizing of the controls with resizing of form and change in screen resolution.

i have used a code liike

dim tmpctrl as control

for each tmpctrl in me.controls
tmpctrl.setbounds((tmpctrls.location.x/X)*me.width, (tmpctrls.location.y/Y)*me.height, (tmpctrls.size.width/X)*me.width,(tmpctrls.size.height/Y*me.height))

next


now as my form is a scrollable form.and the total window portion with respect to which i want to resize n relocate.
m having trouble in choosing X , Y in the above code.

kindly help out please.. :D
 
@luis..
i figured out that stuff.. but my problem is.. that i am having a vertical scrollbar on my form.
if i am using that code. then what happens is.. when i scroll down and again scroll up.. the content gets all messy.. the content below and up the scroll bar gets mixed.. as i am remapping controls to the visible client area.. so once i scroll down and rescroll up.. the content that was earlier under the scrollbar is now on the main screen..

i hope i m being able to convey u the problem
 
@LUIS. brother i am really sorry.. .the code u posted is working fine...
thanks a lot.. :) thanku very much..

m having one more issue.. if u can help ?

nw i want to print the form.. i am using the printform command . .with scrollable option... but when i print i am not getting the complete data on page.. may be because the data does not fit on one page.. can u help me with how to restrict the data to be printed to one page?
 
mukulmukul,

- just before printing resize the form to a size that fits the size and orientation of the printing page (ex: me.with=800:me.height=600)

- call the resize event

- call the printing action

PS. you can save the original size and call the resize event again to get the original form.
 
kool..
yea.. it could be done.. thnx.. wish this thng came to my mind. .was thinking about this for a lot of time..
actually i m a B.tech student.. and i do Freelancing to pay my fees.. thnx.. my project was in middle.. thanks a lot luis..
 
Back
Top