Post by dragonjim on Feb 26, 2017 13:10:45 GMT 1
Interesting...
Amending the example from the help file, this seems to work...
...but we get a problem here...
...and here...
You have most certainly discovered an error here, but it seems rather random; I have tried other examples where everything seems to be going fine (the panels are being reordered as desired) and then I add one more number and either get the 'Illegal Function Call' error as you describe or the panels go back to being ordered as I input them, rather than in the order I specified. I'm guessing that GFA is getting confused when it is sending messages to reorder the panels on the status bar...but that is only a guess.
Could you post the code where it worked with "1" but not the number 1 in the index property?
Amending the example from the help file, this seems to work...
' Constants for the StatusBar Panel Styles
Global Enum sbrText = 0, sbrFlat, sbrRaise, sbrCaps, sbrNum, sbrScroll, sbrIns, sbrDate
' Constants for Text alignment in StatusBar Panels
Global Enum sbrLeft = 0, sbrCenter, sbrRight
Ocx StatusBar sb
sb.Panels.Add , , "Part 1", sbrText
sb.Panels.Add , , "Part 2", sbrFlat
sb.Panels.Add , , "Part 3", sbrRaise
sb.Panels.Add , , "Caps", sbrCaps
sb.Panels.Add 2, , "Num", sbrNum '<---- Num is moved into second in line
Panels.Add , , "Scroll", sbrScroll
sb.Panels.Add , , "INS", sbrIns
sb.Panels.Add , , "c", sbrDate
Do : Sleep : Until Me Is Nothing
...but we get a problem here...
' Constants for the StatusBar Panel Styles
Global Enum sbrText = 0, sbrFlat, sbrRaise, sbrCaps, sbrNum, sbrScroll, sbrIns, sbrDate
' Constants for Text alignment in StatusBar Panels
Global Enum sbrLeft = 0, sbrCenter, sbrRight
Ocx StatusBar sb
sb.Panels.Add 1, , "Part 1", sbrText ' <--- This is fine
sb.Panels.Add 2, , "Part 2", sbrFlat ' <--- Illegal function call here
sb.Panels.Add , , "Part 3", sbrRaise
sb.Panels.Add , , "Caps", sbrCaps
sb.Panels.Add , , "Num", sbrNum
sb.Panels.Add , , "Scroll", sbrScroll
sb.Panels.Add , , "INS", sbrIns
sb.Panels.Add , , "c", sbrDate
Do : Sleep : Until Me Is Nothing
...and here...
' Constants for the StatusBar Panel Styles
Global Enum sbrText = 0, sbrFlat, sbrRaise, sbrCaps, sbrNum, sbrScroll, sbrIns, sbrDate
' Constants for Text alignment in StatusBar Panels
Global Enum sbrLeft = 0, sbrCenter, sbrRight
Ocx StatusBar sb
sb.Panels.Add 1, , "Part 1", sbrText ' <--- This is fine
sb.Panels.Add "2", , "Part 2", sbrFlat ' <--- Illegal function call here
sb.Panels.Add , , "Part 3", sbrRaise
sb.Panels.Add , , "Caps", sbrCaps
sb.Panels.Add , , "Num", sbrNum
sb.Panels.Add , , "Scroll", sbrScroll
sb.Panels.Add , , "INS", sbrIns
sb.Panels.Add , , "c", sbrDate
Do : Sleep : Until Me Is Nothing
You have most certainly discovered an error here, but it seems rather random; I have tried other examples where everything seems to be going fine (the panels are being reordered as desired) and then I add one more number and either get the 'Illegal Function Call' error as you describe or the panels go back to being ordered as I input them, rather than in the order I specified. I'm guessing that GFA is getting confused when it is sending messages to reorder the panels on the status bar...but that is only a guess.
Could you post the code where it worked with "1" but not the number 1 in the index property?