Page 1 of 1
Changing borders and backgrounds on form controls
Posted: Sat Oct 16, 2021 7:39 pm
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
Re: Changing borders and backgrounds on form controls
Posted: Sun Oct 17, 2021 2:31 am
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?
Re: Changing borders and backgrounds on form controls
Posted: Sun Oct 17, 2021 10:09 am
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
Re: Changing borders and backgrounds on form controls
Posted: Sun Oct 17, 2021 10:25 am
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
Re: Changing borders and backgrounds on form controls
Posted: Sun Oct 17, 2021 11:58 am
by fritzdekatt
Well, that's a mouthful, but I'll give it a shot.
Thanks very much,
fritz
Re: Changing borders and backgrounds on form controls
Posted: Mon Oct 18, 2021 4:39 am
by BarryG
What's a mouthful? That code? That's literally nothing. Welcome to coding!
Re: Changing borders and backgrounds on form controls
Posted: Mon Oct 18, 2021 12:06 pm
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
Re: Changing borders and backgrounds on form controls
Posted: Mon Oct 18, 2021 12:49 pm
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.
Re: Changing borders and backgrounds on form controls
Posted: Mon Oct 18, 2021 4:57 pm
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.