Sign in to follow this  
Followers 0
hoffmn

Create custom buttons in MsgBox

4 posts in this topic

I know someone must have asked this before, but I could not find it while I was searching the forums. I want to create a custom dialog box that will pop-up and ask the user to make a choice. I have a script I created to configure a laptops wireless so that students can gain access to the secure wireless on campus. Problem is now we have two campus and two different wireless configurations. I want to offer them a choice as to which campus they would primarily be on so that it does not have to install both.

This is what I found for a simple dialog box that offers yes or no as the choices and continues. Instead of offering yes or no, I want to offer Campus A or Campus B.

;   Prompt for proper campus so the correct settings will be configured
$confirm = MsgBox(4, "Confirmation", "Campus A or Campus B?")
    If $confirm = 6 Then ; Checks for 'Yes'
        MsgBox(0, "Yes", "You clicked 'Campus A'")
    EndIf
    If $confirm = 7 Then ; Checks for 'No'
        MsgBox(0, "No", "You clicked 'Campus B'")
    EndIf

Right now, for testing I have it pop up a window to show which campus was selected. For the final product, I want it to run the necessary code to configure the computer accordingly.

Essentially, I want to be able to label the buttons 'Campus A' and 'Campus B' and then execute my code that I have for each campus.

Share this post


Link to post
Share on other sites



I know someone must have asked this before, but I could not find it while I was searching the forums. I want to create a custom dialog box that will pop-up and ask the user to make a choice. I have a script I created to configure a laptops wireless so that students can gain access to the secure wireless on campus. Problem is now we have two campus and two different wireless configurations. I want to offer them a choice as to which campus they would primarily be on so that it does not have to install both.

This is what I found for a simple dialog box that offers yes or no as the choices and continues. Instead of offering yes or no, I want to offer Campus A or Campus B.

;   Prompt for proper campus so the correct settings will be configured
$confirm = MsgBox(4, "Confirmation", "Campus A or Campus B?")
    If $confirm = 6 Then ; Checks for 'Yes'
        MsgBox(0, "Yes", "You clicked 'Campus A'")
    EndIf
    If $confirm = 7 Then ; Checks for 'No'
        MsgBox(0, "No", "You clicked 'Campus B'")
    EndIf

Right now, for testing I have it pop up a window to show which campus was selected. For the final product, I want it to run the necessary code to configure the computer accordingly.

Essentially, I want to be able to label the buttons 'Campus A' and 'Campus B' and then execute my code that I have for each campus.

You're going to have to make a GUI. MsgBox can't do custom buttons.

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

This script from ProgAndy does what you are asking. I think that making your own GUI would be the easiest way, though. Edited by dantay9

[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites

Thanks for the replies. I will try this, but I almost feel like I am better off doing this with VB.Net. I am much more comfortable using that as my GUI programming language.

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