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

[RESOLVED] Insert symbol in a combobox using combination of keys

$
0
0
Hello,

I am trying to type something in a combobox and when I press for example ALT+a I would like a symbol like "ø" to be inserted at cursor position.

I tried this:

Private Sub ComboBox1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyDown
If e.KeyCode = Keys.Alt And e.KeyCode = 65 Then
ComboBox1.Text = "test"
End If
End Sub

but it doesn't seem to do anything.

So, 2 questions.
1. How can I detect the combination of keys pressed.
2. Is there a function to detect cursor position and insert the text or do I have to create the string myself?

Thx

Viewing all articles
Browse latest Browse all 27209

Trending Articles



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