|
Post by LarryBerry on May 23, 2018 20:44:46 GMT -5
How do I draw a box around a Statictext title on a window? It's been so long I can't remember....Thanks
|
|
|
Post by tsh73 on May 24, 2018 2:20:38 GMT -5
nomainwin
WindowWidth = 192 WindowHeight = 180
statictext #main.statictext1, "This is statictext with border", 26, 16, 104, 55 Stylebits #main.statictext1, _WS_BORDER, 0, 0, 0
open "box around a Statictext" for window as #main print #main, "trapclose [quit.main]"
print #main, "font ms_sans_serif 10"
wait
[quit.main] Close #main END
(adapted from lbpe.wikispaces.com/Stylebits+-+Statictext)
|
|
|
Post by LarryBerry on May 24, 2018 12:22:00 GMT -5
Thanks Tsh...
|
|
|
Post by LarryBerry on May 24, 2018 13:39:54 GMT -5
Tsh...using the Stylebits method I put a box around the statictext but what I really want is to draw a box around the word Appointments and 2 buttons under the statictext. ................ . Appointments . . New Save . ................ New and Save are buttons I have my main window and this is a small part in the main window...I even tried a blank space as a statictext above Appointments but to no avail.
|
|
|
Post by tsh73 on May 24, 2018 14:36:39 GMT -5
It is called GroupBox:
nomainwin
WindowWidth = 240 WindowHeight = 200
groupbox #main.groupbox4, "this is called GroupBox", 6, 1, 160, 85 'empty caption to have just a box around controls 'groupbox #main.groupbox4, "", 6, 1, 160, 85 statictext #main.statictext1, "Appointments", 30, 26, 104, 20 button #main.button2, "New", [button2Click], UL, 22, 51, 40, 20 button #main.button3, "Save", [button3Click], UL, 86, 51, 48, 20 open "untitled" for window as #main print #main, "trapclose [quit.main]"
print #main, "font ms_sans_serif 10"
wait
[quit.main] Close #main END
[button2Click] 'Perform action for the button named 'button2' 'Insert your own code here wait
[button3Click] 'Perform action for the button named 'button3' 'Insert your own code here wait
|
|
|
Post by LarryBerry on May 24, 2018 14:59:43 GMT -5
Once again THANKS! It's a B getting old But if I ever forget to eat you'll know I'm really bad off...
|
|
|
Post by LarryBerry on May 24, 2018 16:21:46 GMT -5
This is a small part of my #main screen. Here is the code I used to get this..almost got the effect STATICTEXT #main.st2," ",544,190,115,80 Stylebits #main.st2,_WS_BORDER,0 ,0 ,0 STATICTEXT #main.st1, " Appointments",544,200,115,22 BUTTON #main, "New", getapt, UL, 552, 226, 45, 18 BUTTON #main, "Show", showit, UL, 606, 226, 45, 18
|
|
|
Post by Rod on May 25, 2018 7:11:21 GMT -5
Trying to draw one control over another is always going to lead to problems. In this code you can use groupbox which works because it is supposed to surround controls. Or you can use the statictext solution which does not work because the buttons do not show through till hovered over. Rem out one or the other to see the difference.
nomainwin button #main.q, "Quit", [quit], LR, 20, 10
groupbox #main.gb "",5,90,125,70 'stylebits #main.st2,_WS_BORDER,0,0,0 'statictext #main.st2," ",5,90,125,70 Stylebits #main.st1,_WS_BORDER,0 ,0 ,0 STATICTEXT #main.st1, " Appointments",10,100,115,20 BUTTON #main.bt1 "New", getapt, UL, 10, 130, 45, 20 BUTTON #main.bt2, "Show", showit, UL,80, 130, 45, 20 open "Demo" for window as #main #main "trapclose [quit]"
wait
[quit] close #main
|
|
|
Post by LarryBerry on May 25, 2018 12:53:36 GMT -5
Rod, I just noticed that there is a box or border around each person's icon...yours surrounds Rod Global Moderator 5 stars Picture Posts: 155
I'll try the groupbox command...thanks
|
|
|
Post by Rod on May 25, 2018 14:33:25 GMT -5
You don't want to mix display machines. A browser that displays this forum interprets and displays HTML code. Liberty interprets and displays "plain" old BASIC. To complicate the issue, Liberty uses Windows controls and rolls it own "gadgets". So make fewer assumptions about how commands are interpretated.
|
|