Sign in to follow this  
Followers 0
mabriseb

Highlight variable value on a MsgBox

6 posts in this topic

I try to Highlight variable value in a MsgBox but there is no function to make it appear in Bold or someting like that.

Does anyone have an idea?

Thanks!


MatMontreal, Canada

Share this post


Link to post
Share on other sites



Hi snapback,

there's definitly no possibility to format character in MsgBox. You must create your own GUI-window. Greetings Johannes

I try to Highlight variable value in a MsgBox but there is no function to make it appear in Bold or someting like that.

Does anyone have an idea?

Thanks!

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

Give me more information or a simplified example. MsgBox exist in other script languages too & anywhere there is no chance to format characters. Use GUI - window and different labels and set for each label other formatting character. See example GUICtrlSetFont in helpfile. Johannes :)


Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

Share this post


Link to post
Share on other sites

OK Thanks!

But if I already have a main GUI and I build a new one for replacing my MsgBox. How can I set the focus on the right window when users come back to the main GUI?


MatMontreal, Canada

Share this post


Link to post
Share on other sites

Here's an example that might get you started.

#include <GuiConstants.au3>

$main = GUICreate("MyGUI", 392, 322)

$Button_1 = GUICtrlCreateButton("MsgBox", 140, 190, 70, 30)

GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_1
            GUISetState(@SW_DISABLE, $main)
            _MsgBox("My Message Box", "Some Text in here")
            GUISetState(@SW_ENABLE, $main)
            GUISetState(@SW_SHOW)
        Case Else
        ;;;
    EndSelect
WEnd
Exit

Func _MsgBox($s_Title, $s_Text)
    $popup = GUICreate($s_Title, 190, 160, -1, -1, $WS_DLGFRAME, $WS_EX_TOPMOST)
    
    $lbl_edit = GUICtrlCreateEdit($s_Text, 10, 10, 170, 80, BitOR($ES_READONLY, $ES_MULTILINE), $WS_EX_TRANSPARENT)
    GUICtrlSetFont(-1, 12, 700)
    GUICtrlSetColor(-1, 0xff0000)   ; Red
    $Button_2 = GUICtrlCreateButton("OK", 60, 100, 60, 20)
    GUISetState()
    While 1
        $msg2 = GUIGetMsg()
        Select
            Case $msg2 = $Button_2
                ExitLoop
            Case Else
            ;;;
        EndSelect
    WEnd
    GUIDelete($popup)
EndFunc  ;==>_MsgBox

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Good!! Thank you for your help!!


MatMontreal, Canada

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0