English
Source / code snippets

Button Echtzeit Text

 

Alfred
Wagner
here one small code where the Text in Echtzeit on one Button changed becomes.
important : Exe File create and started ! otherwise GEHTS not.
here the code :
CompileMarkSeparation
 $P+
SetErrorLevel 0
DEF GETSYSCOLOR(1) !"USER32","GetSysColor"
---------Fenster-------------------------------------------------------
WINDOWSTYLE 63
WINDOWTITLE "Button Texte"
WINDOW 22,20-450,180
SETTRUECOLOR 1
DECLARE ENDE%
CLS GETSYSCOLOR(15)
USEFONT "MS Sans Serif",13,0,0,0,0
SETDIALOGFONT 1
DECLARE BUTTON1&,BUTTON2&,ende&,TEXT1&,TEXT2&
ende& = CREATE("BUTTON",%HWND,"Ende",0320,0110,0090,0025)
Button1& = CREATE("Button",%HWND,"",0012,0075,0190,0025)
Button2& = CREATE("Button",%HWND,"",0220,0075,0190,0025)
TEXT1& = CREATE("TEXT",%HWND,"PC eingeschaltet",0030,0030,0100,0020)
TEXT2& = CREATE("TEXT",%HWND,"PC ausgeschaltet",0230,0030,0100,0020)
Create("Tooltip",%HWND,BUTTON1&,"Hier PC einschalten ...")
Create("Tooltip",%HWND,BUTTON2&,"Hier PC ausschalten ...")
---------- Erklärung Button 1 ---------------------------------------------

PROC BUTTON1_ONCLICK

    Declare hD%, OK%--------- hier wird die Button.exe beendet  (wichtig) -----
    Let Ok% = 1
    Let Ende% = 1
    @DestroyWindow(hD%)
    ----------------------------------------------------------------------------
    Writeini getdir$("@")+"Button.ini","Buttontext","PC eingeschaltet"="Ja"
    Writeini getdir$("@")+"Button.ini","Buttontext","PC ausgeschaltet"="Nein"
    --------- Das oberige wird in die Button.ini geschrieben -------------------
    Shell "Button"--------- und hier wird die Button.exe neu gestartet ---------

ENDPROC

----------- Ende erklärung Button 1 (Button 2 das selbe)--------------------
----------------------------------------------------------------------------

PROC BUTTON2_ONCLICK

    Declare hD%, OK%
    Let Ok% = 1
    Let Ende% = 1
    @DestroyWindow(hD%)
    Writeini getdir$("@")+"Button.ini","Buttontext","PC eingeschaltet"="Nein"
    Writeini getdir$("@")+"Button.ini","Buttontext","PC ausgeschaltet"="Ja"
    Shell "Button"

ENDPROC

---------- Die Button.ini einlesen und Text auf dem Button 1 schreiben --------------------

If Readini$(getdir$("@")+"Button.ini","Buttontext","PC eingeschaltet")="Ja"-----einlesen

    SetText Button1&,"Ja" -----Buttontext------

Elseif Readini$(getdir$("@")+"Button.ini","Buttontext","PC eingeschaltet")="Nein"

    SetText Button1&,"Nein" -----Buttontext---
    Else -------------------------------------Wenn Datei nicht existiert
    SetText Button1&,"BUTTON.INI nicht vorhanden"   -----Buttontext

Endif

---------- Die Button.ini einlesen und Text auf dem Button 1 schreiben ende----------------

If Readini$(getdir$("@")+"BUTTON.INI","Buttontext","PC ausgeschaltet")="Ja"

    SetText Button2&,"Ja"

Elseif Readini$(getdir$("@")+"BUTTON.INI","Buttontext","PC ausgeschaltet")="Nein"

    SetText Button2&,"Nein"
    Else --------------------------------------Wenn Datei nicht existiert
    SetText Button2&,"BUTTON.INI nicht vorhanden"

Endif

SETFOCUS(%HWND)

WHILENOT ENDE%

    WAITINPUT

    If @EQU(%KEY,2)

        LET ENDE%= 1

    ELSEIF @EQU(%KEY,4)

    ELSEIF GETFOCUS(BUTTON1&) BUTTON

        BUTTON1_ONCLICK

    ELSEIF GETFOCUS(BUTTON2&) BUTTON

        BUTTON2_ONCLICK

    ELSEIF GETFOCUS(ende&) BUTTON

        ende%=1

    Endif

WEND


Regards
Alfred
 
WinXP-Home ,XProfan10

Alfreds ... Freeware :  [...] 
03/10/05  
 



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

3.352 Views

Untitledvor 0 min.
RudiB.03/22/20
Uwe Lang08/08/16
Frank Vorholzer06/25/11
mein01/17/11

Themeninformationen

this Topic has 1 subscriber:

Alfred Wagner (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