It is currently Sat Nov 23, 2019 12:33 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: StringGadget Centered Hal & Val [Windows]
PostPosted: Mon Jun 10, 2019 7:34 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3458
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

_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: StringGadget Centered Hal & Val [Windows]
PostPosted: Wed Jun 12, 2019 9:17 am 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4528
Location: Lyon - France
Works great too :wink:
Thanks for sharing 8)

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye