MultiLine StaticText

Just starting out? Need help? Post your questions and find answers here.
Capella
User
User
Posts: 16
Joined: Wed Mar 19, 2008 5:32 pm

MultiLine StaticText

Post by Capella »

What is the equivalent to the object "StaticText" (MultiLine) that is found in VisualBasic? I cannot see anything similar in the "Visual Designer". Is there any better designer tool than "Visual Designer"?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

The TextGadget() supports new lines as well (maybe not in the visual designer).

The simplest is to not use the visual designer and just write the code by hand:

Code: Select all

OpenWindow(0, 0, 0, 512, 384, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
CreateGadgetList(WindowID(0))
TextGadget(0, 10, 10, 200, 200, "First line" + #CRLF$ + "Second line")

Repeat
  Select WaitWindowEvent()
    Case #PB_Event_CloseWindow
      Break
  EndSelect
ForEver
Capella
User
User
Posts: 16
Joined: Wed Mar 19, 2008 5:32 pm

Different fonts in a TextGadget

Post by Capella »

Thanks!

BTW. Is it possible to combine different fonts in a string that is printed in a TextGadget?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

No, you need to use an EditorGadget() or ScintillaGadget() to do that.
Post Reply