Changing borders and backgrounds on form controls

You need some new stunning features ? Tell us here.
fritzdekatt
New User
New User
Posts: 5
Joined: Sat Oct 16, 2021 7:33 pm

Changing borders and backgrounds on form controls

Post by fritzdekatt »

Friends

Is there some relatively simple way to change or eliminate the borders and backgrounds on controls, especially the text input controls? I just want a borderless, colorless text input box (and label).

Thank you,
fritz
BarryG
Addict
Addict
Posts: 3267
Joined: Thu Apr 18, 2019 8:17 am

Re: Changing borders and backgrounds on form controls

Post by BarryG »

fritzdekatt wrote: Sat Oct 16, 2021 7:39 pmI just want a borderless, colorless text input box
In the designer, or in your running app? Because you asked in the designer forum, so it sounds like this is a designer request?
fritzdekatt
New User
New User
Posts: 5
Joined: Sat Oct 16, 2021 7:33 pm

Re: Changing borders and backgrounds on form controls

Post by fritzdekatt »

I'm totally new, so I'm assuming most design configurations would be somehow encompassed in the form designer, but obviously many IDEs (like Xojo or VB.NET) let you change visual attributes in code. If I can't change these attributes in the designer itself, I'll try it in code. Can you do that?
Thank you,
fritz
BarryG
Addict
Addict
Posts: 3267
Joined: Thu Apr 18, 2019 8:17 am

Re: Changing borders and backgrounds on form controls

Post by BarryG »

For Windows, do you mean something like this?

Code: Select all

If OpenWindow(0, 400, 200, 322, 60, "StringGadget", #PB_Window_SystemMenu)
  StringGadget(0, 8, 20, 306, 20, "Type here...", #PB_String_BorderLess)
  SetGadgetColor(0, #PB_Gadget_BackColor, GetSysColor_(#COLOR_3DFACE))
  SetActiveGadget(0)
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
fritzdekatt
New User
New User
Posts: 5
Joined: Sat Oct 16, 2021 7:33 pm

Re: Changing borders and backgrounds on form controls

Post by fritzdekatt »

Well, that's a mouthful, but I'll give it a shot.
Thanks very much,
fritz
BarryG
Addict
Addict
Posts: 3267
Joined: Thu Apr 18, 2019 8:17 am

Re: Changing borders and backgrounds on form controls

Post by BarryG »

What's a mouthful? That code? That's literally nothing. Welcome to coding!
fritzdekatt
New User
New User
Posts: 5
Joined: Sat Oct 16, 2021 7:33 pm

Re: Changing borders and backgrounds on form controls

Post by fritzdekatt »

I guess it's all relative. Compared to VB.Net and PHP/CSS, your graphic alterations seem pretty encyclopedic. Now that I think of it, TKinter Python is way less wordy with borders and backgrounds. Xojo is okay with text boxes, but any other kind of input field is pretty counterintuitive when you want to change the gui defaults. Of course, my reaction to your kindly provided example is exacerbated by the simple fact that I know nothing about PureBasic.
Thanks,
fritz
BarryG
Addict
Addict
Posts: 3267
Joined: Thu Apr 18, 2019 8:17 am

Re: Changing borders and backgrounds on form controls

Post by BarryG »

fritzdekatt wrote: Mon Oct 18, 2021 12:06 pmyour graphic alterations seem pretty encyclopedic
You mean this single line of code to eliminate the background color?

Code: Select all

SetGadgetColor(0, #PB_Gadget_BackColor, GetSysColor_(#COLOR_3DFACE))
It's pretty easy to follow. We're just setting the background color of gadget number 0 to the system color of 3D Face.
fritzdekatt
New User
New User
Posts: 5
Joined: Sat Oct 16, 2021 7:33 pm

Re: Changing borders and backgrounds on form controls

Post by fritzdekatt »

I'm sure it would all seem more comprehensible if I had a background in PureBasic. As I mentioned, VB.Net and PHP have spoiled me. And, it is true, that one line you sent, stripped of all the other stuff, seems perfectly readable to me.
Post Reply