I have created a keyboard program i am using a textbox as the output and buttons for the input. is there anyone who knows hw i could use the caps lock feature
i am currently tryin 2 use a check box however the problem arises after i uncheck the box because if i pres another button the letters still apear in CAPITALS
11 1484
can you give the piece of code that handles the capitals?
it would help very much
Well so far I have come up with this code:
but again when I unchek the chekbox everything in the text box turns to lowercase: - Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
-
If Me.CheckBox1.Checked = True Then
-
Me.TextBox1.CharacterCasing = CharacterCasing.Normal
-
End If
-
If Me.CheckBox1.Checked = False Then
-
Me.TextBox1.CharacterCasing = CharacterCasing.Lower
-
End If
-
End Sub
If your trying to simulate a caps-button, I would use something like this: - Private Sub button_a() Handles button_a.Click
-
if checkbox1.checked = true then
-
textbox1.text = textbox1.text & "A"
-
else
-
textbox1.text = textbox1.text & "a"
-
end if
-
end sub
This for all of your buttons.
Yarr
hint: use code-tags, it helps people reading your code
If your trying to simulate a caps-button, I would use something like this: - Private Sub button_a() Handles button_a.Click
-
if checkbox1.checked = true then
-
textbox1.text = textbox1.text & "A"
-
else
-
textbox1.text = textbox1.text & "a"
-
end if
-
end sub
This for all of your buttons.
Yarr
hint: use code-tags, it helps people reading your code
in this case, wouldnt it be easier to write in the keypress event something like
if checkbox1.checked = true then keyascii = asc(ucase(chr(keyascii)))
Instead of writing a case for each key
HTH
in this case, wouldnt it be easier to write in the keypress event something like
if checkbox1.checked = true then keyascii = asc(ucase(chr(keyascii)))
Instead of writing a case for each key
HTH
I don't think it's usefull in this case, because he is using buttons on a form for the typing, he's create something like "on-screen keyboard"
Ô_o wait a sec
was it checkbox1.checked or checkbox1.value??
Well if you have troubles with one of them, try the other.
Well so far i have come up with this code:
but again when i unchek the chekbox everything in the text box turns to lowercase - Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
-
If Me.CheckBox1.Checked = True Then
-
Me.TextBox1.CharacterCasing = CharacterCasing.Normal
-
End If
-
If Me.CheckBox1.Checked = False Then
-
Me.TextBox1.CharacterCasing = CharacterCasing.Lower
-
End If
End Sub
Actually, there's nothing wrong with this code, but it's the logic behind it that is wrong.
Actually, there's nothing wrong with this code, but it's the logic behind it that is wrong.
Yes, this code says to convert whatever is currently in the textbox to upper or lower case. What you actually need to do is check the current setting of the checkbox before adding each character.
I don't think it's usefull in this case, because he is using buttons on a form for the typing, he's create something like "on-screen keyboard"
i see, but it depends on how he is doing it. anyway, it can be written in the keypress event of the form.
or when the checkbox is checked, in the keydown event of the form, if the keycode is between 65 and 90, then it puts chr(keycode) in the textbox.
i see, but it depends on how he is doing it. anyway, it can be written in the keypress event of the form...
I think the point yarr was making is that no keyboard events will be happening, since the user is just clicking the mouse.
I think the point yarr was making is that no keyboard events will be happening, since the user is just clicking the mouse.
oh, i see... sorry, hadnt understand.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: kchengso |
last post by:
One of my printers in my printer.devicename call returns in lower case. Is
it possible for me to change it to upper case? I am also wondering how, in
the first place, this particular printer...
|
by: Nick Calladine |
last post by:
Is this possible to ...
I wish to get the value of a dropdown select but gets is indexable value
(dont know if that is the right term) if that is possible (the position it
assigned get assigned...
|
by: Richard Holliingsworth |
last post by:
Hello:
The group has new 'standards' for online forms and I need to change the
'style' of my existing forms (A2002). Can I do this? I can't find a
way using the GUI or the properties.
...
|
by: MLH |
last post by:
What's the simplest way to allow a user
of an A97 app to change password?
|
by: Imran Aziz |
last post by:
Hello All,
I want to change the size of my hyper lnks in a repeater control dynamially
using the onItemBound event, as under, but cannot seem to understand how to
alter the properties to do...
|
by: Jan |
last post by:
Hi:
I have created a secured database for a client. For various reasons, I
don't want the client to have full persmissions for the database; they
aren't in the admins group. I have instead tried...
|
by: Sankalp |
last post by:
Hi,
I am using VB 2005. My application has many data bound controls. The
connection is stored in the app.config file.
I want the application to start with a default connection string and
while...
|
by: Denis |
last post by:
How can you get the contents of a text box to change after for click
out of it. Eg I have a text box on a form called Ownername. If some
one enters a name in lower case that it automatically...
|
by: Gianni Mariani |
last post by:
Attached example CPP files makes it easier to post code and extract code
from posts. It's unimaginable at this time where virtually any news
reader is capable of dealing with attachments to stick...
|
by: Adem |
last post by:
C/C++ language proposal:
Change the 'case expression' from "integral constant-expression" to "integral expression"
The C++ Standard (ISO/IEC 14882, Second edition, 2003-10-15)
says under...
|
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: 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: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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,...
| |