PureBasic Forum http://forums.purebasic.com/english/ |
|
StringGadget Centered Hal & Val [Windows] http://forums.purebasic.com/english/viewtopic.php?f=12&t=72994 |
Page 1 of 1 |
Author: | RASHAD [ Mon Jun 10, 2019 7:34 pm ] |
Post subject: | StringGadget Centered Hal & Val [Windows] |
Hi Very simple and very flexible Have fun Code: LoadFont(0,"Tahoma",24)
OpenWindow(0, 0, 0, 600, 400, "StringGadget ", #PB_Window_SystemMenu|#PB_Window_ScreenCentered| #PB_Window_SizeGadget) SetWindowColor(0,#White) ContainerGadget(0,10,10,580,110,#PB_Container_Flat) SetGadgetColor(0,#PB_Gadget_BackColor,$FFFFFF) StringGadget(1, 0,0,580,120,"ABCDE-JQMN"+#CRLF$+"Hello",#PB_String_BorderLess| #ES_CENTER | #ES_MULTILINE) SetGadgetColor(1,#PB_Gadget_FrontColor,$0000FF) CloseGadgetList() ch = GadgetHeight(0) ;SetWindowLongPtr_(GadgetID(1),#GWL_EXSTYLE, GetWindowLongPtr_(GadgetID(1),#GWL_EXSTYLE)&~ #WS_EX_CLIENTEDGE) SetGadgetFont(1,FontID(0)) sh = GadgetHeight(1,#PB_Gadget_RequiredSize)*2 ;No of Lines ResizeGadget(1,0,ch/2-sh/2,#PB_Ignore,sh) Repeat Until WaitWindowEvent() = #PB_Event_CloseWindow |
Author: | Kwai chang caine [ Wed Jun 12, 2019 9:17 am ] |
Post subject: | Re: StringGadget Centered Hal & Val [Windows] |
Works great too ![]() Thanks for sharing ![]() |
Page 1 of 1 | All times are UTC + 1 hour |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |