English
Source / code snippets

solid Hintergrndfarbe Text box Textfeldern Vorder

 

CompileMarkSeparation
Source wurde am 15.07.2007 aus der MMJ-Quellcodesammlung (Dietmar Horn) in die Babyklappe auf XProfan.Com abgelegt:
Textfeld: Vorder- und Hintergrundfarbe von Textfeldern festlegen
-Begin-----------------------------------------------------------------
-HeaderFiles---------------------------------------------------------
 $H Windows.ph
 $H Messages.ph
-Variables Declaration-----------------------------------------------
Declare Ende%, OldWndProc&, hButton%
Declare hText1%, TextBk1&, hText2%, TextBk2&, hText3%, TextBk3&
-CallBack Routine----------------------------------------------------

Proc ColorText

    Parameters hWnd&, Message&, wParam&, lParam&

    If Message& = ~WM_CTLCOLORSTATIC

        -Fuer Text1 Farbe setzen---------------------------------------

        If lParam& = hText1%

            ~SetBkMode(wParam&, ~TRANSPARENT)
            ~SetTextColor(wParam&, @RGB($FF, $00, $00)) -Rot-----------
            Return TextBk1&
            -Fuer Text2 Farbe setzen---------------------------------------

        ElseIf lParam& = hText2%

            ~SetBkMode(wParam&, ~TRANSPARENT)
            ~SetTextColor(wParam&, @RGB($00, $00, $FF)) -Blau----------
            Return TextBk2&
            -Fuer Text3 Farbe setzen---------------------------------------

        ElseIf lParam& = hText3%

            ~SetBkMode(wParam&, ~TRANSPARENT)
            ~SetTextColor(wParam&, @RGB($00, $FF, $00)) -Gruen---------
            Return TextBk3&

        EndIf

    Else

        Return ~CallWindowProc(OldWndProc&, hWnd&, Message&,
        wParam&, lParam&)

    EndIf

EndProc

-Main----------------------------------------------------------------
-Hintergrundfarben festlegen---------------------------------------
TextBk1& = ~CreateSolidBrush(@RGB($00, $FF, $FF)) -Cyan----------
TextBk2& = ~CreateSolidBrush(@RGB($FF, $FF, $00)) -Gelb----------
TextBk3& = ~CreateSolidBrush(@RGB($FF, $00, $FF)) -Magenta-------
-Erweitertes MessageHandling abschalten----------------------------
Set(FastMode, 1)
-Fenster oeffnen---------------------------------------------------
Window 0, 0 - 640, 480
-ProgramMainRoutine mit CallBack umleiten auf eigene---------------
OldWndProc& = ~GetWindowLong(%hWnd, ~GWL_WNDPROC)
~SetWindowLong(%hWnd, ~GWL_WNDPROC, @ProcAddr(ColorText, 4))
-GUI aufbauen------------------------------------------------------
hButton% = @Create(Button, %hWnd, Ende, 10, 10, 100, 24)
-Textfelder------------------------------------------------------
hText1% = @Create(Text, %hWnd,  Farbiger Text1, 10, 50,
110, 18)
hText2% = @Create(Text, %hWnd,  Farbiger Text2, 10, 70,
110, 18)
hText3% = @Create(Text, %hWnd,  Farbiger Text3, 10, 90,
110, 18)
-Dialog-Schleife---------------------------------------------------
Clear Ende%

WhileNot Ende%

    WaitInput

    If %Key = 2

        Ende% = 1

    ElseIf @Clicked(hButton%)

        Ende% = 1

    EndIf

EndWhile

-Fuellmuster freigeben---------------------------------------------
~DeleteObject(TextBk1&)
~DeleteObject(TextBk2&)
~DeleteObject(TextBk3&)
-Urspruengliche ProgramMainRoutine wieder herstellen---------------
~SetWindowLong(%hWnd, ~GWL_WNDPROC, OldWndProc&)
-End------------------------------------------------------------------<
- End
 
07/15/07  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

2.067 Views

Untitledvor 0 min.
H.Brill06/07/23
rafl09/17/17
Rene196501/04/15
Paul Glatz09/27/14
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie