1 Attachment(s)
[RESOLVED] Form Size According to Controls in it...
When my Program runs
its looks all bad because the form is out of shape..
please look at the attachment.. controls finish somewhere else and still shows a lot of space after that
How do i make sure that all forms are sized properly according to controls inside it??
:)
Re: Form Size According to Controls in it...
Re: Form Size According to Controls in it...
excellent coding
but that is not my problem
see that extra blank at the right hand side.. i need to remove that..
as i have kept the resize = false in the form so it wont resize so that code will not work which is in that link
i need to fix that size.. in design mode it looks ok.. there is no gap after controls on the right hand side
Re: Form Size According to Controls in it...
compute where the right edge of a control would be (control.left * control.width)
If this is the righmost one you have found so far, remember it for later.
Loop through this for all controls on your form.
When you are done looping, set the form.width to the righmost value you found when you did your looping.
Re: Form Size According to Controls in it...
This is an odd question. If you don't want your form to be resizing then disable it. Set the borderstyle to 1 or Fixed Single at design time. It seems that you dont want to mess with the controls inside, all you wanted was to keep the form as is during design and runtime.
Re: Form Size According to Controls in it...
see.. i think i did not get my point right
look at the pic.. u see that extra space on right hand side.. it comes during runtime.. but not at design time..
how do i remove that extra width which is showing on the right hand side...
Re: Form Size According to Controls in it...
I see you don't get my point either. Have you tried my suggestion?
Set your borderstyle to Fixed Single. Because there's no way it'll change the size unless the windowstate is maximized at design time.
Re: Form Size According to Controls in it...
yep
working.. thanks zynder
repped and thread resolved :)
Re: [RESOLVED] Form Size According to Controls in it...