|
-
Oct 2nd, 2005, 08:23 AM
#1
Thread Starter
New Member
[RESOLVED] vb window resizing
Hi all
im trying to figure out how to resize my list box
What I have is a vb program when run and the apropriate data is inputed, calcualations are done and then are outputed to a listbox what i want to know is there a way to have the listbox resize when the main window is resized.
Ed
-
Oct 2nd, 2005, 08:33 AM
#2
Re: vb window resizing
take a look at this thread.........use the code specified by MartinLiss:
Resize
hope it shud help u!!! it will resize other controls (those which can be resized) on the object/form!!
-
Oct 2nd, 2005, 08:36 AM
#3
Junior Member
Re: vb window resizing
Hi Edward
Try following:
go to the Event of Form_Paint() and write
ListBox.Top = 10
ListBox.Left = 10
ListBox.Height = me.Height - 20
ListBox.Width = me.Width - 20
me is the Form itself and the Value of 20 must be adjusted for your Form.
if you have a Scrollbar then is mayby 200 nice.
Chris
-
Oct 2nd, 2005, 08:49 AM
#4
Re: vb window resizing
 Originally Posted by Chris67
Hi Edward
Try following:
go to the Event of Form_Paint() and write
ListBox.Top = 10
ListBox.Left = 10
ListBox.Height = me.Height - 20
ListBox.Width = me.Width - 20
me is the Form itself and the Value of 20 must be adjusted for your Form.
if you have a Scrollbar then is mayby 200 nice.
Chris
Chris!
ur idea seems to be good except, if the size of the list box is small then there is a possibilty of control n the form to flicker!!!
i hope i m correct, coz Paint event is generally avoided if u want to resize controls instancing on the object!!
-
Oct 2nd, 2005, 09:13 AM
#5
Junior Member
Re: [RESOLVED] vb window resizing
yes, and just use 'on error resume next' statement to ignor all errors
Chris
-
Oct 2nd, 2005, 09:30 AM
#6
Re: [RESOLVED] vb window resizing
 Originally Posted by Chris67
yes, and just use 'on error resume next' statement to ignor all errors
Chris
are u replying to my post???? i m not saying any error occurred in your method!!
but if u use a larger value instead of 20, then the form n the contained controls will flicker!!
PS - maybe i m wrong..........i m saying coz this is a common problem with Paint event!!
-
Oct 2nd, 2005, 10:00 AM
#7
Junior Member
Re: [RESOLVED] vb window resizing
I'm not sure if the flicker an coz problem but if you play with the Values you get a better result, 20 was just a example.
The Error handle must be integrated because if you minimized the Form you get errors.
Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|