• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 975
  • Last Modified:

Set flexgrid height, lose scrollbars

I am trying to control the height of a flexgrid depending on the number of rows it has.

cwayflex2 is the flexgrid

FormFlex.Width = Cwayflex2.Width + 500
Cwayflex2.Height = Cwayflex2.Rows * 700
FormFlex.Height = Cwayflex2.Height + 600

if I use this the grid and form looks great but no scroillbars

If I remove this line:
Cwayflex2.Height = Cwayflex2.Rows * 700
scrollbars are back but the flexgrid does not appear as I want.
Any suggestions would be greatly appreciated.
I am using VB6
1 Solution
Is it a case where the scrollbars only appear when the rows and / or columns exceed the width / height of the flexgrid?
You can not control the coming and going of scrollbars in a flexgrid. If you set the scrollbars property to none then they will not appear at all, but you set it to both or horizontal or vertical then depending upon the rows and columns in your grid they will appear and disapper.
mhedrickAuthor Commented:
The scroll bars in the flexgrid property is on(vertical)
I am just trying to make  the form look nice.
The rows will vary depending on the users input.  So I did not want to just
make the flexgrid a fixed sized.  If there is only 2 records it will look silly but if
there are more records than the actual screen size you cannot get to the records
that are off the page to see what they are.   I will try adjusting the multiplyer on the flexgrid height to
if this helps

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now