Valhalla Legends Archive

Programming => General Programming => Topic started by: prairienetworks on April 22, 2003, 06:47 PM

Title: ASCII key typer source (VB)
Post by: prairienetworks on April 22, 2003, 06:47 PM
Hey I am looking for the source code for one of those ascii key typers.  You know, lots of buttons with ASCII and if you click one it displays that character in a text box that the user can then ctrl+c and paste in bnet.  Even if it only has one button I would like to see the source code, I have no idea how to make it.  Thanks for your help.
Title: Re:ASCII key typer source (VB)
Post by: Yoni on April 22, 2003, 07:07 PM
What, you mean like charmap?
Title: Re:ASCII key typer source (VB)
Post by: Tazo on April 22, 2003, 08:04 PM
You know, theres this great site called www.pscode.com . Use it.
Search for character map. I have done this for you, though.
Character Map (http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=21241&lngWId=1)

[edit] realized it wasn't search results; it was just a site
Title: Re:ASCII key typer source (VB)
Post by: iago on April 23, 2003, 11:48 AM
Just have a button, and when it's pressed, "txtOut = txtOut + chr(&h20)", and stuff like that :-/

It's horribly simple to do in vb...
Title: Re:ASCII key typer source (VB)
Post by: Spht on April 23, 2003, 02:25 PM
Quote from: iago on April 23, 2003, 11:48 AM
Just have a button, and when it's pressed, "txtOut = txtOut + chr(&h20)", and stuff like that :-/

It's horribly simple to do in vb...

Or you could set up a index of buttons all with the same name, then on Form_Load(), you'd write in the character you want for each button:

Private Sub Form_Load()
   Dim i%
   For i = button.LBound To button.Ubound
       button(i).Caption = Chr(65 + i)
   Next i
End Sub


That example will loop through the button index and starting with 'A', it will caption all buttons 'A', 'B', 'C', etc. up to however many buttons you've placed on the form.

Then when you click a button, this could be called which will add the character to a variable or object (depending on what output is):

Private Sub button_Click(Index As Integer)
   output = output & button(i).Caption
End Sub
Title: Re:ASCII key typer source (VB)
Post by: Mesiah / haiseM on April 23, 2003, 09:47 PM
spht, are you sure button captions can display all extended ascii? i know the vb debug window and other manual controls cant...