Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing an MSHFlexGrid's column caption
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00443405
Message ID:
00443644
Vues:
9
>Hi All,
>
>I have a MSHFlexGrid on a form and I'm not having much luck changing the captions for the column headers. MSDN talks about using the .ColHeaderCaption to do it but it's not working for me.
>
>I stepped through the code in the debugger and the ColHeaderCaption starts with the field name from the recordset, then changes to the caption I specify, but the grid on the form retains the fieldname for the caption??? The following code is in the load event of a form:
>
>
Private Sub Form_Load()
>    On Error GoTo ErrHandler:
>
>    Set obmData = New BM_Data
>    Set oRs = obmData.GetRecordSet("BasinTypeList")
>
>    Dim ExpColWidth As Integer
>
>    oRs.MoveFirst
>    With grdSelect
>        ExpColWidth = .Width - 2000
>        Set .DataSource = oRs
>        .ColWidth(0, 0) = 0
>        .ColWidth(1) = 0
>        .ColWidth(2) = ExpColWidth
>        .ColWidth(3) = 0
>        .ColWidth(4) = 0
>        .ColWidth(5) = 500
>        .ColWidth(6) = 500
>        .ColWidth(7) = 800
>        .ColHeaderCaption(0, 2) = "Basin Code"
>        .ColHeaderCaption(0, 5) = "Width"
>        .ColHeaderCaption(0, 6) = "Depth"
>        .ColHeaderCaption(0, 7) = "Wall Thickness"
>
>    End With
>
>    Set oForm = New frmBasinTypeDetail
>    SelectGrdClicked = False
>
>    Exit Sub
>ErrHandler:
>    ErrorHandler.ShowError "frmLuBasinType", "Form_Load"
>    Exit Sub
>End Sub
>
>Any ideas? TIA

Hi Roi,

I tried formatting string and it works for me. Here is the code:
    dim strFS as String
    strFS = "    |Mother|^Father|Son|Daughter|"
    MyGrid.FormatString = strFS
HTH, Igor
Igor Gelin
Database Developer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform