Left And Right Shift Key?
Mar 24, 2010Can VB.NET Form keyDown event determine whether left or right shift (alt, control) key was pressed? I always receive the same keycode (16) for both left and shift key!
View 3 RepliesCan VB.NET Form keyDown event determine whether left or right shift (alt, control) key was pressed? I always receive the same keycode (16) for both left and shift key!
View 3 RepliesI've been trying to write code below many time, but it still doesn't work.
Public Class Form1
Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.LShiftKey Then
MsgBox("Left Shift")
End If
End Sub
End Class
So I don't how to do it continue to get Left Shift Key pressing.
How do I pull off an unsigned left shift in VB.Net while using Option Strict? Maybe I am doing it wrong, but while trying to implement my own IP2Long function (I have my reasons), I'm testing things to make sure I have my head wrapped around the conversion process properly. Tried a few tests, all seem to cause errors.
Dim a As Int32
a = CUint(172 << 24) 'Constant expression not representable in type 'UInteger'
a = DirectCast((172 << 24), UInt32) 'Value of type 'Integer' cannot be converted to 'UInteger'
a = Convert.ToUInt32(172 << 24) 'Compiles, but throws an OverflowException
The last one is especially befuddling. 172 << 24 is a mere 2,885,681,152, well under the limit imposed by the UInt32 data type. My assumption is .NET is doing the left-shift in signed mode, then tries to convert, to unsigned, and this tosses up some kind of error. Basically, my question boils down to this: why do unsigned numeric have to act like such hacks to the .NET framework at times? Is it really that hard for Microsoft to make Unsigned data types intrinsic to the framework?
How to hold shift and then click button a and b (while holding shift)?
View 7 RepliesIn my keydown event handler, when Keys.Numpad4 is pressed with Shift, I get the same keycode code as for Keys.Right. Is this by design? How can I distinguish between the two?
View 5 RepliesI'm using vb2008 Is that possible to change the pointer from left to right to right to left in the TextBox.
View 4 RepliesIs that possible to change the pointer from left to right to right to left in the TextBox. to became as it show in the pic below.
View 2 RepliesI am trying to figure out how to make a .SubString get the characters from right to left not left to right.Say if a user enters 123456789 in text box 1 and I use textbox1.text.SubString(0,2) it will display 12. But, I want it to get 89.I do not want it to get 98, but 89. I tried textbox.text.substring (0, -2) but that just gives an error.So if Gold is entered it gets ld
Fun
it gets un
VisualBasic
it gets ic
I got a panel that i am adding labels to. I have autoscroll enabled on it so when they fill the viewable space it scrolls. but i need to put the labels to the left unviewable space(when left scroll is already at 0) The label is placed but i dont get the scroll bars and i cant force it to scroll to a - value.
Is this even possible? Same thing with UP.
Or is the Scroll only limited to Bottom and Right?
I don't know how to get shift modifier key as when I pressed shift and another key, it show message box "Modifier shift key"
View 1 RepliesI have been able to toggle CAPS, NUM AND SCROLL lock using the method below but using the code below that although no error occours when I click the button nothing happens?The code which works for caps, num and scroll
[Code]...
I just found an interesting problem between translating some data:
VB.NET: CByte(4) << 8 Returns 4
But C#: (byte)4 << 8 Returns 1024
[code].....
When I run this command in PHP, I get:
[Code]...
The interesting thing is, that when I try to shift any number greater than int32 in .net, it yields bad results.. Every number under int32 (2147483647) yields the same results from php and c#.net or vb.net Is there a workaround for this in .net?
I am running out of function keys and it will be nice if I can double up on some of them with the Shift Alt or Ctrl keys.I am using
if e.keydown = keys.F3 then{it does what it is supposed to}end if I tried e.keydown = keys.F3 AND e.keydown = keys.Shift but it gets ignored. Am I seeking the impossible or am I just missing something?Can some one tell me what I am missing or point me to an example?
Trying to develop a text editor, I've got two textboxes, and a button below each one.When the button below textbox1 is pressed, it is supposed to convert the Unicode text (intended to be Japanese) to Shift-JIS.The reason why I am doing this is because the software VOCALOID2 only allows ANSI and Shift-JIS encoding text to be pasted into the lyrics system. Users of the application normally have their keyboard set to change to Japanese already, but it types in Unicode.How can I convert Unicode text to Shift-JIS when SJIS isn't available in the System.Text.Encoding types?
View 1 RepliesIn vb6 when you wanted to alter the effect of a mouse click, you could use the mouse down event and alternate the action depending on the value of the shift, control and alternate key. (and also detecting if the right or left mouse button was clicked)
When trying these in my project, I couldn't find the right codes to do this. I can't imagine this feature isn't available so I'm sure I am just messing up somehow.
I am trying to rotate a select number of bits to right with click of a button. ( bit 7 to bit 0 and rotate.) The patterns should not matter. It could be any combination of set or reset bits. The bit patterns are selected by checkbox0 to checkbox7. I like to rotate without a carry bit. Is there any way(s) to do this?
View 6 RepliesI have been working on a visual Basic 2010 program to writw a Telnet script in VB Script. I have exerything working fine but need a way to send Shift+CNTL+6 to exit the telnet session.
View 7 RepliesHow do I bitwise shift right/left in VB.NET? Does it even have operators for this, or do I have to use some utility method?
View 4 RepliesIs there a pre-existing method in vb.net to shift elements? Like the following.
Code:
testArray elements:
0: ""
1: ""
[Code].....
I know how to sendkeys, SendKeys.Send("Hello") I know how to hit other keys, Sendkeys.Send("{ENTER}")
But how do I HOLD DOWN the Shift key, I want to be able to highlight text, I know, I need to press the Arrow keys while the shift key is held down...
So... How is it possible to Hold down the Shift key
Oh yeah, and I even know how to simimulate a mouse click, drag, let go, ect. ect...
how to hold down the shift key in VB.NET?
I am trying to simulate holding down the shift key in code while I open an Access database to bypass the Autoexec macro using the following code.
1
Imports Microsoft.Office.Interop
2
Imports System.IO
[Code].....
I'm trying to make a prank program that registers all of the letter keys on the keyboard and then will make random message boxes pop-up when you press certain ones, or just re-arrange the letters.But before adding any pranks, I'm trying to just get all of the hotkeys to work like a normal keyboard because when you register a key to be a hotkey, it no longer works for anything else. So registering "e" in the program will cause "e" to do nothing when your in notepad or something.
So far I've gotten pretty much everything to work except for this weird Shift bug. Whenever I press Shift and then a letter, the Sendkeys will correctly send the uppercase key, however as soon as I release shift and press a key without it, it still keeps the uppercase for one more letter.So if I press Shift + E then "E" will be successfully sent to Notepad, but then if I just press "b", "B" will be sent instead, but then after that first error it will successfully send lowercase again.
I was using wordlabel to store the letters so as to see if the shift uppercase problem was something in my coding, but actually when I press Shift + A and then just press a, it will do Aa in the label but AA in a program with the focus, like Notepad. So I don't know if this is a problem with Sendkeys or what but does anyone know of a solution?
I have this code which shifts the alphabet by a certain amount. The size of the alphabet is 26. When I enter a larger size shift (for example 22) I get some weird characters displaying. I think I need to mod the ASCII alphabet to 26 to get it working but Im not quite sure which bit to mod. Basically I need to wrap around the alphabet (once it reaches Z it goes back to letter A) Do I have to create a dictionary for the mod to work (like A = 0... Z = 26) or can I stick with using the normal ASCII table? Here is the code below:
Public Function encrypt(ByVal input As String) 'input is a variable within the funcion
Dim n as Integer
Dim i As Integer
[code]....
I have some questions regarding vb.net bit shifting. I understand the << >> operators are bit shift operators in vb.net. I have a two byte hex value 0x3ACC, each bit in this two byte represents either a day, month or year. The bit structure of this hex value is yyyy yyym mmmd dddd. I am confused as to how I should bit shift these values so that year, month and day are in their own UINT16 values. Just want to know about shifting numbers and if I need to add any padding to the shift?
View 1 RepliesPossible Duplicate: How do I get the current state of Caps Lock in VB.NET? I am wanting to create two functions related to key input:
Dim capsLock As Boolean = GetCapsLockState() 'imaginary function
Dim shiftKey As Boolean = GetShiftKeyState() 'imaginary function
a company have many employees and Time In & Time Out Logs for attendance. they are not assign any shift time for each employees. day shift and nightshift also available. How to find the shiftdate and corresponding TimeIn-TimeOut Log for each employees?
View 3 RepliesI want a form to pop-up when I click ctrl+shift+l how can i do that
View 1 RepliesHow can we prepare a rota application which changes the shift so that all the employees get to work in different shifts and in the month end the number of shifts done by all the employees should be the same..
View 1 RepliesI am writing a program using VB6 and i can write and read to a file using the System.IO.StreamWriter and System.IO.StreamReader. Now i am trying to delete an entry in the file and shift the remaing entry's up to prevent a blank line.[code]...
View 2 Replies