Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FlexGrid
Message
De
21/04/2004 14:50:17
 
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00896672
Message ID:
00896997
Vues:
21
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!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform