ControlSetStyle not working in GroupBox under certain conditions.

Issue #39 closed
Winter Laite created an issue

The following two sets of code differ in only one line - the creation of a GroupBox.

First code:

MyGui := Gui(, "KEYSHARP TESTS")
t2g2t1 := MyGui.Add("Text", "xp y+10 w200 cBlue", "Password entry")
t2g2t1.SetFont("s10")
e1 := MyGui.Add("Edit", "x10 w200 y+10 +0x20")
t2g2t2 := MyGui.Add("Text", "xp y+10 w250 cBlue", "Alternate password entry (*)")
t2g2t2.SetFont("s10")
e2 := MyGui.Add("Edit", "w200 Password*")
t2g2t3 := MyGui.Add("Text", "xp y+10 w250 cBlue", "Uppercase - ControlSetStyle")
t2g2t3.SetFont("s10")
e3 := MyGui.Add("Edit", "w200 h50")
ControlSetStyle("+0x8", e3.Hwnd)
t2g2t4 := MyGui.Add("Text", "xp y+10 w250 cBlue", "Uppercase - +0x8")
t2g2t4.SetFont("s10")
e4 := MyGui.Add("Edit", "w200 h50 +0x8")
MyGui.Show()

Second code:

MyGui := Gui(, "KEYSHARP TESTS")

gb1 := MyGui.Add("GroupBox", "x10 y10 w220 h310", "Style in GroupBox test") ;

t2g2t1 := MyGui.Add("Text", "xp y+10 w200 cBlue", "Password entry")
t2g2t1.SetFont("s10")
e1 := MyGui.Add("Edit", "x10 w200 y+10 +0x20")
t2g2t2 := MyGui.Add("Text", "xp y+10 w250 cBlue", "Alternate password entry (*)")
t2g2t2.SetFont("s10")
e2 := MyGui.Add("Edit", "w200 Password*")
t2g2t3 := MyGui.Add("Text", "xp y+10 w250 cBlue", "Uppercase - ControlSetStyle")
t2g2t3.SetFont("s10")
e3 := MyGui.Add("Edit", "w200 h50")
ControlSetStyle("+0x8", e3.Hwnd)
t2g2t4 := MyGui.Add("Text", "xp y+10 w250 cBlue", "Uppercase - +0x8")
t2g2t4.SetFont("s10")
e4 := MyGui.Add("Edit", "w200 h50 +0x8")
MyGui.Show()

Consider lines 10 & 11 in Code 1 and lines 13 & 14 in Code 2, i.e.

e3 := MyGui.Add("Edit", "w200 h50")
ControlSetStyle("+0x8", e3.Hwnd)

For the code without a GroupBox, Edit ‘e3’ is correctly restricted to uppercase.

For the code with a GroupBox, Edit ‘e3’ is not restricted to uppercase.

Comments (5)

  1. Log in to comment