Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27224

VS 2010 Create Preset System Variables from button

$
0
0
Is there a way to have it so when I click a button on a form, it then changes a presetup system Variable to X.
I have 16 buttons, and each button 1-16 sets the variable to 1-16 depending on what button is pressed.

I then have a separate Auto Hot Key Script running in the background that uses the system variable to choose which program it will run.


I would image something like this:
vb Code:
  1. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
  2. Set Variable = 3
  3. [HKEY_LOCAL_MACHINE\SOFTWARE\OTS]
  4. "Button"="3"
  5.     End Sub
  6.    
  7.  Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
  8. Set Variable = 5
  9. [HKEY_LOCAL_MACHINE\SOFTWARE\OTS]
  10. "Button"="5"
  11.     End Sub

Is setting a variable from a button possible?

Viewing all articles
Browse latest Browse all 27224

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>