|
Post by Roger Cabo on Aug 10, 2022 17:18:45 GMT 1
Hi, I can't access the .value in an ocx array unfortunately. OcxOcx Frm1 CheckBox HatKinder(0) = "Test", 10, 10, 200, 22 HatKinder(0).Value = True // Unknown Property
Does a workaround exit?
|
|
|
Post by dragonjim on Aug 10, 2022 17:39:51 GMT 1
This works fine for me...
Form frm1 OcxOcx frm1 CheckBox HatKinder(0) = "Test", 10, 10, 200, 22 HatKinder(0).Value = 1 // Unknown Property Trace HatKinder(0).Value
|
|
|
Post by (X) on Aug 10, 2022 17:49:35 GMT 1
It would seem <chkbox>.value type is not boolean, but, integer?
So: (<chkbox>.value <> 0 ) should return a boolean value that mirrors the values:{0, 1 and 2 (if ThreeState enabled)}.
OpenW 1 OcxOcx Win_1 CheckBox chk(0) = "Checkbox_0" , 10, 10, 100, 20 : chk(0).ThreeState = True : chk(0).Value = 2 : Trace chk(0).Value OcxOcx Win_1 CheckBox chk(1) = "Checkbox_1", 10, 30, 100, 20
Do Sleep Loop Until Me Is Nothing
Sub chk_Click(index%) Trace index Trace chk(index).Value Trace F_ChkBoxState(chk(index)) Trace TypeName(chk(0).Value) EndSub
Function F_ChkBoxState(chk As CheckBox) As Bool Return (chk.Value <> 0) EndFunc
|
|
|
Post by dragonjim on Aug 10, 2022 17:58:16 GMT 1
Value for Checkbox is an integer: 0 (unchecked), 1 (checked) and 2 (dimmed)
|
|
|
Post by Roger Cabo on Aug 10, 2022 19:33:23 GMT 1
I got it.. my mistake.. I have mixed up 2 control types with the same base name But the funny thing is.. without Perso1(id).Value = True ... it works like a charm.. I understand the internally problem of gb32, because of the different properties on an array with 2 different types. $Library "gfawinx" $Library "UpdateRT" UpdateRuntime ' Patches GfaWin23.Ocx
LoadForm frm1
Dim id%, x% = 20, y% = 20, width% = 90, plus_x% = 20 Dim fx1_Perso_1$(1) fx1_Perso_1$(0) = "Checkbox"
OcxOcx frm1 TextBox Perso1(id) = , x + plus_x * 2, y, 22 + width, 22 Perso1(id).BorderStyle = 0 : Perso1(id).MaxLength = 4 Perso1(id).Appearance = 4 Perso1(id).FontSize = 11 Perso1(id).Alignment = 2 id++
// Hat Kinder OcxOcx frm1 CheckBox Perso1(id) = fx1_Perso_1$(id), x + 280 - 50, y - (10 * 40 - 14), 100, 25 Perso1(id).BackColor = RGB(255, 255, 255) Perso1(id).ForeColor = RGB(100, 100, 100) Perso1(id).Value = True id++
|
|