Form editor: Fix reading and writing of color properties so that they do not trigger an overflow. Forms must be updated and recompiled!

[DEVELOPMENT ENVIRONMENT]
* BUG: Form editor: Fix reading and writing of color properties so that they do not trigger an overflow. Forms must be updated and recompiled!
This commit is contained in:
Benoît Minisini 2022-12-10 18:37:17 +01:00
parent 529e382122
commit 74bb0fde23
2 changed files with 5 additions and 1 deletions

View File

@ -875,7 +875,7 @@ Private Function ConvertToString(vVal As Variant, hProp As CPropertyInfo) As Str
If IsLong(vVal) Then
sVal = Hex$(vVal, 8)
If sVal Begins "00" Then sVal = Mid$(sVal, 3)
Return "&H" & sVal & "&"
Return "&H" & sVal
Else
Return vVal
Endif

View File

@ -440,6 +440,10 @@ Private Sub FromString(sData As String, Optional hParent As CControl) As String
Else
If sValue Begins "&" And If sValue Ends "&" Then
sValue = Left(sValue, -1)
Endif
Try vValue = CInt(Val(sValue))
If Not Error Then Goto SET_PROPERTY