Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

msflexgrid resizing itself for the best fit/display on the screen?!

Status
Not open for further replies.

croiva25

Technical User
Dec 3, 2003
125
AU
Hi Guys, Happy New Year,

Have a problem that I am not sure how to go about, so some help or some sample code would be useful,have done a search but found nothing.

I have a treeview on the left side of my screen and by clcking on the links in the tree view, screens are getting displayed on the right side of the screen.
I also have a little image on the right border of the tree view that hides the tree view and only displays what's on the right side of the screen (now all that works fine) but I have a msflexgrid that is very wide and when users hide the tree view by clicking on the image the msflexgrid doesn't become bigger, doesn't resize itselft.

So, I would like to, by clicking on the image that hides the treeview, resize the msflexgrid to its best size for the screen.

Don't have any code at the moment for this part....

Hopefully that makes sense and somebody can help me out.

Thanks and regards
 
Hey there,

From what i gather, you want to resize a flexgrid when you click on a command button to hide a treeview?

If this is the case, then in the button_click() command, simply set the following:

msFlexGrid1.Top = form1.Top
msFlexGrid1.Left = form1.Left
msFlexGrid1.Height = form1.Height
msFlexGrid1.Width = form1.Width

You may need to adjust these values dependant on other controls on the form, so that is does not hide them. You may also want to put this code into the form_resize event (assuming the form is resizable).

Regards

Dan

 
Not quite,
I am already hiding the treeview by clicking on an image, but I would like my grid once the treeview is hiden to resize itself as much as possible on the form/screen so that is easy to read and then when I click on the image and treeview is displayed for my msflexgrid to go back to its original size.

Regards

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top