Jump to content

Create custom buttons in MsgBox


hoffmn
 Share

Recommended Posts

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.

Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...