Author Topic: Alphanumeric Keypad  (Read 7267 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Alphanumeric Keypad
« on: July 11, 2016, 11:21:54 AM »
- Download the attached file
- In Visual Studio Solution Explorer, under the AdvancedHMIControls project, right click the PurchasedControls folder
- Select Add->Existing
- Browse to the downloaded file


Example of use:

        Dim kpd As New AdvancedHMIControls.AlphaKeyBoard2
        kpd.PassWordCharacters = True
        kpd.ShowDialog()

Joe Matkowski

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Alphanumeric Keypad
« Reply #1 on: July 28, 2016, 01:11:37 PM »
 I had to add "Imports MfgControl.AdvancedHMI.Controls" to get it to compile is that correct

Morgan

  • Newbie
  • *
  • Posts: 44
    • View Profile
Re: Alphanumeric Keypad
« Reply #2 on: August 16, 2016, 12:40:54 PM »
I like your on screen keyboard, although I am not sure why you added the Public Event ButtonClick.  I added upper/lower characters and special characters so that I could use it for passwords.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Alphanumeric Keypad
« Reply #3 on: August 16, 2016, 02:14:18 PM »
The ButtonClick event is used by the parent to know when to take action for things like clicking Quit or Enter. For example:
Code: [Select]
If e.Key = "Quit" Then

End If

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: Alphanumeric Keypad
« Reply #4 on: August 29, 2016, 11:44:13 PM »
Hi Archie, I'm trying to make use of the keypad to enter an IP address into a text box.  I followed the instructions above and added this .vb to my purchased controls folder.  I am using 3.99a but get the attached errors.  Thanks

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: Alphanumeric Keypad
« Reply #5 on: August 29, 2016, 11:45:16 PM »
added more screenshots, thx

DanieLoche

  • Guest
Re: Alphanumeric Keypad
« Reply #6 on: August 30, 2016, 05:07:04 AM »
Do you have the following line above the code were belongs the error ?

Code: [Select]
Imports MfgControl.AdvancedHMI.Controls
Should solve the problem.

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: Alphanumeric Keypad
« Reply #7 on: August 30, 2016, 08:09:35 AM »
Yes I did add this code, however I put it in the main form code since that is where I was writing the kpd code.  I now have moved it to the AlphaKeyPad2.vb and it works great!  Thanks for the help. 

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Alphanumeric Keypad
« Reply #8 on: October 30, 2016, 03:43:12 PM »
Here is a modified version of the AlphaKeyboard2 and also its button control.

It has half-sized keys for special characters, allows to be moved on the screen and has round corners if one of the background picture files is selected. It also has a password feature and multiple PLCAddressKeypad entries are supported. At Runtime, the control will default to the first address entered and right-clicking the button will pop-up a menu with available addresses to choose from.

Background files are in the next post and need to be added to the AdvancedHMIControls project Resources as existing images. If you don't want backgrounds then comment out all the "If" statements within the AlphaKeyboardBackground property.

The attached picture shows what the keyboard looks like.

It does have one small bug, which is when the text is highlighted it will be transparent.
« Last Edit: December 28, 2016, 09:12:56 AM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Alphanumeric Keypad
« Reply #9 on: October 30, 2016, 03:51:38 PM »
The attached file has backgrounds for the modified AlphaKeyboard in the previous post.

Extract the files, right-click the AdvancedHMIControls project, select Properties and in the Properties window select Resources, switch to Images, click Add Resource drop down and select Add Existing File. Browse to location where you extracted the files and select them all at once.

Rebuild the project (if necessary close the project, re-open it and then rebuild it).

Phrog30

  • Guest
Re: Alphanumeric Keypad
« Reply #10 on: May 12, 2017, 03:33:39 PM »
I like your on screen keyboard, although I am not sure why you added the Public Event ButtonClick.  I added upper/lower characters and special characters so that I could use it for passwords.

I can't exactly remember, but I think this is the alphakeyboard I downloaded and am using.  FYI, there is a bug in the backspace event, where it will allow a backspace with nothing there, this causes a crash:

I changed to this:
Code: [Select]
Private Sub BackSpaceButton_Click(sender As System.Object, e As System.EventArgs) Handles BackSpaceButton.Click

        Dim CurrentCursorPos As Integer = TextBox1.SelectionStart
        If CurrentCursorPos > 0 Then
            TextBox1.Text = TextBox1.Text.Substring(0, TextBox1.SelectionStart - 1) & TextBox1.Text.Substring(TextBox1.SelectionStart)
            TextBox1.SelectionStart = CurrentCursorPos - 1
            TextBox1.Focus()
        End If
    End Sub