Set flexgrid height, lose scrollbars

Posted on 2005-05-12
Last Modified: 2008-02-01
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
Question by:mhedrick
    LVL 12

    Accepted Solution

    Is it a case where the scrollbars only appear when the rows and / or columns exceed the width / height of the flexgrid?
    LVL 18

    Expert Comment

    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.

    Author Comment

    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

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Mysql vs Oracle 10 105
    Help in WHSCRIPT 9 31
    MsgBox 2 29
    Adding to a VBA? 6 31
    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now