Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FlexGrid
Message
From
21/04/2004 14:50:17
 
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00896672
Message ID:
00896997
Views:
22
Hello friend:

You can place Text in header with some like this, it is the easiest way I know but there is another way
a bit difficult but more effective and precise, I will give you both here.

SIMPLE WAY

Private Sub Form_Load()
'Asigning the numbers of rows and Cols to display
MyFlexGrid.Cols = 4
MyFlexGrid.Rows = 1

'Let's Place some text in Header
MyFlexGrid.Row = 0
MyFlexGrid.Col = 1
MyFlexGrid.Text = "Morning"

MyFlexGrid.Col = 2
MyFlexGrid.Text = "Noon"

MyFlexGrid.Col = 3
MyFlexGrid.Text = "Evening"

'Let us place some data in the Grid
With MyFlexGrid
.AddItem "Women" & vbTab & "10" & vbTab & "20" & vbTab & "25"
.AddItem "Men" & vbTab & "7" & vbTab & "12" & vbTab & "35"
.AddItem "Children" & vbTab & "30" & vbTab & "21" & vbTab & "25"
End With
' you can also add information to cells by using the TextMatrix property of the flex
End Sub

'I almost forget this, there is a simple method of assigning text to Headers rows, with the FormatString property of the FlexGrid

'WITH THE FORMATSTRING PROPERTY
'You need to learn the use of some characters that you will use when using this property

'Character Meaning
' | Separates text that should be placed in different columns of the grid's header row
' < Left-Align the Column
' > Right-Align the Column
' ^ Center the column
' ; Begin Row Information

'For Example, to create a grid with 3 columns labeled with "Morning", "Noon" and "Evening", use this format string:
MyFlexGrid.FormatString ="Morning|Noon|Evening"

'what about to display the numbers of visitors to the Museum of Arts over a period of time during the day?
'that could be done using format string like this:
MyFlexGrid.FormatString ="|>Morning|Noon|Evening;Women|Men|Children"

'As you might notice, the formatting string contains an extra Pipe character to the left of the word "Morning";
'This causes the upper-left cell of the FlexGrid to be blank, cool huh?

I hope this can help you Friend, enjoy computer programming!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform