Hello Guest it is March 28, 2024, 07:16:23 AM

Author Topic: How to make a popup when a button is selected?  (Read 8229 times)

0 Members and 1 Guest are viewing this topic.

Offline mike^3

*
  •  116 116
    • View Profile
How to make a popup when a button is selected?
« on: March 22, 2014, 04:41:08 PM »
Hello,

Can anyone help me make an onscreen button pop up a message? Once you hit OK then the box will disappear?

I just need the VB script to say "Make sure Turret UP button is pressed before homing turret!"

Thank you!

Mike

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: How to make a popup when a button is selected?
« Reply #1 on: March 22, 2014, 04:50:27 PM »
msgbox ("Make sure Turret UP button is pressed before homing turret!")
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline mike^3

*
  •  116 116
    • View Profile
Re: How to make a popup when a button is selected?
« Reply #2 on: March 22, 2014, 04:53:07 PM »
Thanks, but I think I have a problem...the button I put was to home A. Can I put the Home A macro in the VB script after the msg box?

I would like to press the Home A button, have the msg pop up, click ok, then run the homing cycle for A.

Thanks ger!

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: How to make a popup when a button is selected?
« Reply #3 on: March 22, 2014, 05:00:21 PM »
Yes. I think it's #24


msgbox ("Make sure Turret UP button is pressed before homing turret!")
DoButton(24)
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline mike^3

*
  •  116 116
    • View Profile
Re: How to make a popup when a button is selected?
« Reply #4 on: March 22, 2014, 05:15:15 PM »
DoButton(24) seems to home just the Z, what the number for A axis?

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: How to make a popup when a button is selected?
« Reply #5 on: March 22, 2014, 05:41:05 PM »
Try 25
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline mike^3

*
  •  116 116
    • View Profile
Re: How to make a popup when a button is selected?
« Reply #6 on: March 22, 2014, 06:56:04 PM »
Can you have a command prompt with an ok or cancel in the dialog box? So I can cancel out of it instead of continuing the homing...?

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: How to make a popup when a button is selected?
« Reply #7 on: March 22, 2014, 07:38:16 PM »
I'm not sure. You'll need to look through the examples in the Cypress Basic manual.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: How to make a popup when a button is selected?
« Reply #8 on: March 22, 2014, 07:51:52 PM »
Try this.

Response = MsgBox ("Warning !!!" & (Chr(13)) & ""Make sure Turret UP button is pressed before homing turret!" & (Chr(13)) & "Press OK To Continue" & (Chr(13)) & "Or Press Cancel to Exit ",49,"Press Turret Up Button!!")

   If Response = 1 Then ' If OK
      ' Continue Homing
      ElseIf Response = 2 Then ' If Cancel
      Exit Sub
   End If
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline mike^3

*
  •  116 116
    • View Profile
Re: How to make a popup when a button is selected?
« Reply #9 on: March 22, 2014, 10:39:47 PM »
Thanks! Let me try that real quick :)