LB Booster
« Foreground Color in Statictext Control »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:22am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Foreground Color in Statictext Control  (Read 234 times)
Jack Kelly
Full Member
ImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 106
xx Foreground Color in Statictext Control
« Thread started on: Aug 14th, 2016, 7:44pm »

Is there any way to get a different foreground color in an individual statictext control? I suppose this question has been discussed adnauseum over the years, but please bear with me. I can't get Cundo's trick to work -- making a popup window a child.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx Re: Foreground Color in Statictext Control
« Reply #1 on: Aug 14th, 2016, 8:45pm »

on Aug 14th, 2016, 7:44pm, Jack Kelly wrote:
Is there any way to get a different foreground color in an individual statictext control?

The workaround I use is to replace the statictext control with a texteditor control configured to look the same. It's a bit messy but it works (LBB only):

Code:
    statictext #w.st, "This is a regular STATICTEXT control", 10, 10, 300, 30
    stylebits #w.te, _ES_READONLY, _WS_HSCROLL or _WS_VSCROLL or _WS_DLGFRAME, 0, 0
    texteditor #w.te, 10, 50, 300, 30
    open "Colored statictext" for window as #w
    hw = hwnd(#w)
    calldll #user32, "SetMenu", hw as ulong, 0 as long, r as void
    #w.te "!backcolor buttonface"
    #w.te "!forecolor red"
    #w.te "This is a TEXTEDITOR control masquerading as statictext";
    #w.st "!setfocus"
    wait 

Richard.
User IP Logged

Jack Kelly
Full Member
ImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 106
xx Re: Foreground Color in Statictext Control
« Reply #2 on: Aug 15th, 2016, 08:00am »

Thanks again, Richard. As always, that did the trick!
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls