flexgrid question
Results 1 to 5 of 5

Thread: flexgrid question

  1. #1
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,786

    flexgrid question

    Im working on a project in VB6 using ms flexgrid. when the program loads all the columns come up pushed all the way over to the left making the whole thing look like crap.

    anybody know how to size the columns at runtime??

    TIA
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

  2. #2
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,914
    Hey Hey


    I believe this is what you are asking about, but u can correct me if I'm wrong.. and I'll try and provide a solution for your problem.


    This depends on what FlexGrid you are using..... if you use the MS Hierarchical FlexGrid.. it should work fine..

    MSFlexGrid.ColWidth(X) = (width)

    where X is the Column you are addressing.. (0, 1, 2, 3......... N)

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,786
    thanks for the reply!

    Its 'microsoft FlexGrid Control 6.0' found under project>>components

    I've tried many ways to make it work:

    Private Sub Form_Load()
    Dim ColWidth As Long
    Dim Field1
    Dim Field2
    Dim Field3
    MSFlexGrid1.ColWidth(Field1) = 500
    MSFlexGrid1.ColWidth(Field2) = 200
    MSFlexGrid1.ColWidth(Field3) = 5000

    End Sub

    i keep fooling with this 'MSFlexGrid.ColWidth(X) = (Width)' but i kept getting "object not defined so i dimmed everything

    all the change i do just seem to affect field1 and the column i want to affect is field2
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

  4. #4
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,914
    Try using just numbers.. 0,1,2 and so on.. deal with it like it's an array...

    your other option is to use:

    Microsoft Hierarchical FlexGrid Control 6.0 found in the same spot.. this one will definately accept ColWidth....

  5. #5
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,786
    HTRegz your da man!

    Private Sub Form_Load()
    MSFlexGrid1.ColWidth(1) = 3200
    End Sub

    this is working with the MSFlex grid as well as MSHFlexGrid

    but it looks great now, thanks again
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •