Jump to content


Photo

Button assign HELP! (VisualStudio2008)

- - - - -

  • Please log in to reply
2 replies to this topic

#1
ImpactMan

ImpactMan

    Newbie

  • Members
  • Pip
  • 4 posts
  • Devices:OMNIA i900
Hello!

I'm trying to develop one application for pocket pc with Visual Studio 2008.

Now, I'm having troubles, cause I want to make a button of my application correspond to one hardware key!

For example, I want software button1 makes the same that dpad UP key!

Not getting any results! I've already try to search it on google and forums but, not helping!

So, if anyone here could help, I will be glad!


I've made a simple example to make me understanding... see the picture below:

Attached File  Button_assign.jpg   49.79KB   72 downloads

__________________________________________________ __________________________________________________ __
Here is my try:

Public Class Form1

Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click

'Bye!

Application.Exit()

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpButton.Click

'Up

!!!!!!CODE HELP PLEASE!!!!!!!

End Sub

__________________________________________________ __________________________________________________ __


Any one there could code one button to me please???


Regards

Edited by ImpactMan, 31 October 2008 - 01:18 AM.

  • 0

#2
DaveShaw

DaveShaw

    Newbie

  • Members
  • Pip
  • 19 posts
  • Location:Huddersfield
  • Devices:HTC Kaiser
Why not make "UP" the same as Button1 Like so

Public Class Form1

	Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
		If (e.KeyCode = System.Windows.Forms.Keys.Up) Then
			'UP
			Button1_Click(sender, e)
		End If
		If (e.KeyCode = System.Windows.Forms.Keys.Down) Then
			'Down
		End If
		If (e.KeyCode = System.Windows.Forms.Keys.Left) Then
			'Left
		End If
		If (e.KeyCode = System.Windows.Forms.Keys.Right) Then
			'Right
		End If
		If (e.KeyCode = System.Windows.Forms.Keys.Enter) Then
			'Enter
		End If

	End Sub

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		MessageBox.Show("Pressed Up")
	End Sub
End Class

Ta
Dave

  • 0

#3
mrlacey

mrlacey

    Newbie

  • Members
  • Pip
  • 1 posts
  • Gender:Male
  • Location:UK
  • Devices:Touch Dual

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users