hi,
I'm new to VB , and I've created a typing program that displays the character pressed and highlights it on the screen. The program displays the characters on a ReadOnly textbox. I could code all characters including the backspace and the enter. The only problem I'm facing right now is how to make the shift key display capital letters ?
I tryed doing it the hard way with an if statement and then cases of all letters , yet it didn't word :(
I know someone can help, and I hope they will
thank you
11 1362
You need to handle the KeyDown event.
that's what I did for all characters. I used the TextBox_KeyDown , how can I use it for the shift key?
Hi,
In KeyUp or KeyDown, Check for "Shift" -
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
-
If Shift = 1 Then
-
MsgBox "Shift Pressed.."
-
End If
-
End Sub
-
Regards
Veena
thanks alot veena, but my problem is:
when the user press the shift key, how can I make the next letter pressed capital ?
I know when the user presses the shift key using this line of code
Case e.keyCode = Keys.ShiftKey
but how can I make it work, that's capilaizing the next letter ?!
Case e.keyCode = Keys.ShiftKey
but how can I make it work, that's capilaizing the next letter ?!
Some thing Like this :
UCase(Chr((e.KeyCode)))
REgards
Veena
how do I apply what you wrote on the next letter ?
should I an if statement ?
Hi,
Declare a Form Level Boolean Variable say, MyShift.
In Key Up Check if Shift is pressed, Make -
If e.keyCode = Keys.ShiftKey Then
-
MyShift = Not MyShift 'This Allows you to Toggle Upper and Lower Case
-
End If
-
And use an If Condition..
If MyShift Then
Regards
Veena
Thank you so much Veena, that worked :)
there's also a minor problem with the Alt key
when the user presses alt, the corresponding button should be highlighted, but because I have a menu strip in my program, pressing the alt key causes the focus to be on the menu strip
Hi,
Yes, that's a bit problem...
One work-around is :
While User Starts Typing, Disable or Hide the Menu.. and Show a Button with "Menu" as caption.
and Trap the "Alt" Key Pressed in Key Down event.
When the user is done typing, and if he wants the menu, then
in Button_Click event , Hide the button and Show the menu..
Little bit of coding is involved..
REgards
Veena
thanks alot you've been a great help
Sign in to post your reply or Sign up for a free account.
Similar topics
by: dterrors |
last post by:
Will php 6 do strong typing and/or namespaces?
I was shocked to find out today that there are some people who actually
argue that weak typing is somehow better. I didn't even know there was
a...
|
by: Michael Muller |
last post by:
Is there currently any plan to introduce static typing in any future
version of Python? (I'm not entirely sure that "static typing" is the right
term: what I'm talking about is the declaration of...
|
by: mike420 |
last post by:
THE GOOD:
1. pickle
2. simplicity and uniformity
3. big library (bigger would be even better)
THE BAD:
|
by: Jason Tesser |
last post by:
I work for at a college where I am one of 2 full-time
developers and we are looking to program a new
software package fro the campus. This is a huge
project as it will include everything from...
|
by: Premshree Pillai |
last post by:
How do I force static typing in Python?
-Premshree Pillai
=====
-Premshree
http://www.qiksearch.com/]
________________________________________________________________________
Yahoo! India...
|
by: Gabriel Zachmann |
last post by:
Is it correct to say that strong/weak typing does not make a difference
if one does not use any pointers (or adress-taking operator)?
More concretely, I am thinking particularly of Python vs C++....
|
by: bearophileHUGS |
last post by:
Adding Optional Static Typing to Python looks like a quite complex
thing, but useful too:
http://www.artima.com/weblogs/viewpost.jsp?thread=85551
I have just a couple of notes:
Boo...
|
by: riscy |
last post by:
I'm having odd behaviour of VS 2003 pro recently. It happen when Dell
9200 returned from repairs with new motherboard to fix audio out
socket problem (as they say). I installed Visual Assist X and...
|
by: samslists |
last post by:
Hi...
I want to write a program that will let me know after thirty minutes of
typing that I need to take a five minute typing break. But when I stop
typing it's smart enough to pause the 30...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |