[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:


your list is a String[] Array ["False", "True"]

But I assume FMain.bFontStyle is Boolean

So try Str() to get a String version of the Boolean value like this...

CbxStyles.Text = CbxStyles.List[CbxStyles.Find(Str(FMain.bFontStyle))]  '
Use Str() on the Boolean

Or maybe simply this...
CbxStyles.Text = Str(FMain.bFontStyle)

BruceS


On Sun, 2 Feb 2025 at 21:39, Philippe Valarcher <philippe.valarcher@xxxxxxx>
wrote:

> Bonsoir,
> is someone can helping me in debbugging this part :
>
> Public Sub Form_Open()
>
> Dim fontName As String
> Dim fontTaille As String
> Dim fontStyle As String
>
> CbxFonts.Clear()
> CbxTailles.Clear()
> CbxStyles.Clear()
>
> ' Module_Settings.RestorePolice
>
> For Each fontName In Fonts
> CbxFonts.Add(fontName)
> Next
>
> For Each fontStyle In ["False", "True"]
> CbxStyles.Add(fontStyle)
> Next
>
> For Each fontTaille In ["8", "9", "10", "11", "12", "13"]
> CbxTailles.Add(fontTaille)
> Next
>
> CbxFonts.Text = CbxFonts.List[CbxFonts.Find(FMain.sFontName)]
> CbxTailles.Text = CbxTailles.List[CbxTailles.Find(FMain.iFontSize)]
> ' CbxStyles.Text = CbxStyles.List[CbxStyles.Find(FMain.bFontStyle)]
>
> End
>
> If I uncomment the last line the program fail with this :
>
>
> --
>
> Regards
>
> Philippe Valarcher <philippe.valarcher@xxxxxxx>
>

PNG image


Follow-Ups:
Re: FMain.bFontStyle is BooleanPhilippe Valarcher <philippe.valarcher@xxxxxxx>
Re:Fabien Bodard <gambas.fr@xxxxxxxxx>
References:
[no subject]Philippe Valarcher <philippe.valarcher@xxxxxxx>