| | |
change column width in MSFlexgrid
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2008
Posts: 10
Reputation:
Solved Threads: 0
Hi Friends,
how can i change the columns width in MSflexgrid by code from 1.jpg to 2.Jpg
I have copied this code in my Module:
and i have called this function in my Form Load
can u please help me
Thanks,
Singoi
how can i change the columns width in MSflexgrid by code from 1.jpg to 2.Jpg
I have copied this code in my Module:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Public Function Grid_AutoSize(oGrid As MSFlexGrid, oLabel As Label) Dim nRow As Long Dim nCol As Long Dim nWidth As Long Dim nMaxWidth As Long ' Setzen der Eigenschaften With oLabel With .Font .Name = oGrid.Font.Name .Size = oGrid.Font.Size .Bold = oGrid.Font.Bold .Italic = oGrid.Font.Italic .Strikethrough = oGrid.Font.Strikethrough .Underline = oGrid.Font.Underline End With ' Wichtig! .WordWrap = False .AutoSize = True End With ' Auswerten und Setzen der Grössen With oGrid For nCol = .FixedCols To .Cols - 1 nMaxWidth = 0 For nRow = .FixedRows To .Rows - 1 oLabel.Caption = .TextMatrix(nRow, nCol) nWidth = oLabel.Width If nWidth + 100 > nMaxWidth Then nMaxWidth = nWidth + 100 Next nRow .ColWidth(nCol) = nMaxWidth Next nCol End With End Function
and i have called this function in my Form Load
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Grid_AutoSize msf1, lbltemp Dim m As Long For m = 1 To msf1.Cols + 1 msf1.ColWidth(-1) = 1400 Next
can u please help me
Thanks,
Singoi
Hi,
Try This :
With a little bit of judgement, you can do it..
Regards
Veena
Try This :
vb Syntax (Toggle Plain Text)
msf1.ColWidth(0) = 400 msf1.ColWidth(1) = 1000 msf1.ColWidth(2) = 1200 msf1.ColWidth(3) = 1200 msf1.ColWidth(4) = 1500
With a little bit of judgement, you can do it..
Regards
Veena
![]() |
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Internet bandwidth and Traffic
- Next Thread: Help with Search & ListView codes.
Views: 1706 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp c++ calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver struct subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





