|
Post by metro on Dec 31, 2018 1:11:33 GMT -5
Can someone shed some light on why controls in this window appear smaller after a refresh I'm just testing with this code before I make changes to my main program thanks in advance EDIT: it appears you can't relocate controls in a dialog has to be a window nomainwin button #1.btn1, "&Ok", [quit], UL, 120, 90, 40, 25 checkbox #1.cb, "I am a checkbox", checkDone, checkReSet, 10, 10, 130, 20 textbox #1.text, 10, 90, 100, 24 WindowWidth = 180 WindowHeight = 160 open "Checkbox test" for dialog as #1 print #1, "trapclose [quit]"
wait
sub checkDone cbHandle$ print #cbHandle$, "value? v$" print #1.text, "I am ";v$ #1.btn1, "!locate 5000 500 0 0" #1, "refresh" end Sub
sub checkReSet cbHandle$
print #cbHandle$, "value? v$" print #1.text, "I am ";v$ #1.btn1, "!locate 120 90 40 25" #1, "refresh"
end Sub
[quit] close #1 end
|
|
|
Post by mknarr on Dec 31, 2018 9:37:03 GMT -5
From the help file on REFRESH:
|
|
|
Post by tsh73 on Dec 31, 2018 10:27:55 GMT -5
So it doesn't work in Dialog Then, what do you want from Dialog that not in Window?
|
|
|
Post by metro on Dec 31, 2018 15:43:02 GMT -5
Thanks for the replies, @ tsh73 , I have got into the habit of using dialog_modal "pop ups" for sub-forms, I like the ability to be able to press "ESC" to close the form in this instance I was looking to re-locate a control off the screen and drop another in its place. then vice versa with a CHECKBOX @ mknarr , an interesting concept all egotistical males in my family jump straight into projects and learn as we go when things go wrong and after a lot of head scratching.....
there is always someone that points out "If all else fails "READ THE INSTRUCTIONS" I thought I had to REFRESH after a LOCATE I'll read the help file in future thanks for the input
|
|
|
Post by mknarr on Jan 1, 2019 11:33:19 GMT -5
Actually if I were going to do what you are doing, I would do it this way.
nomainwin button #1.btn1, "&Ok", [quit], UL, 120, 90, 40, 25 checkbox #1.cb, "I am a checkbox", checkDone, checkReSet, 10, 10, 130, 20 textbox #1.text, 10, 90, 100, 24 WindowWidth = 180 WindowHeight = 160 open "Checkbox test" for dialog as #1 print #1, "trapclose [quit]"
wait
sub checkDone cbHandle$ print #cbHandle$, "value? v$" print #1.text, "I am ";v$ #1.btn1, "!hide" end Sub
sub checkReSet cbHandle$
print #cbHandle$, "value? v$" print #1.text, "I am ";v$ #1.btn1, "!show" end Sub
[quit] close #1 end
|
|
|
Post by metro on Jan 1, 2019 20:36:03 GMT -5
Thanks mknarr that does the job
|
|