Binary Shift Differences Between C#?

Nov 16, 2011

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].....

View 3 Replies


ADVERTISEMENT

Binary - Add Padding - Bit Shift Numbers

Nov 5, 2010

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 Replies

Hold Shift And Then Click Button A And B (while Holding Shift)?

Jan 10, 2010

How to hold shift and then click button a and b (while holding shift)?

View 7 Replies

Distinguish Between Numpad 4 + Shift And Right + Shift?

Dec 15, 2009

In 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 Replies

Combine Shift With Another Key?

Feb 9, 2011

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 Replies

Left And Right Shift Key?

Mar 24, 2010

Can 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 Replies

.net - Toggle Shift, Control, And Alt Key?

Dec 6, 2011

I 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]...

View 1 Replies

Bitwise Shift - Getting Different Results In C#.net Vs PHP

May 15, 2011

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?

View 2 Replies

Can Shift+F3 Be Detected With E.keydown?

Feb 7, 2012

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?

View 2 Replies

Convert Unicode In One TB To Shift-JIS In Another TB?

Jun 10, 2010

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 Replies

Detecting Shift Key On Mousedown?

Sep 5, 2011

In 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.

View 2 Replies

Do Rotate Right Without Carry (Shift Towards LSB)?

May 11, 2010

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 Replies

Key Code For Shift+CRTL+6?

Nov 19, 2011

I 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 Replies

Operators - How To Bitwise Shift In .NET

Sep 13, 2009

How 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 Replies

Shift Elements In An Array?

Oct 3, 2008

Is there a pre-existing method in vb.net to shift elements? Like the following.

Code:
testArray elements:
0: ""
1: ""

[Code].....

View 3 Replies

Simulate Holding Down The Shift Key?

Dec 12, 2009

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?

View 4 Replies

Using SetKeyboardState To Set The Shift Key State

Feb 27, 2009

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].....

View 1 Replies

VS 2005 Hotkeys With Shift?

Apr 25, 2009

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?

View 1 Replies

.net - Mods And ASCII In VB Caesar Shift?

Apr 10, 2012

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]....

View 1 Replies

Continue To Get Left Shift Key Pressing

Jan 20, 2011

I'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.

View 2 Replies

Detecting If Shift/caps Lock Is On?

Jan 15, 2012

Possible 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

View 1 Replies

Find A Shiftdate Without Assign Shift?

May 30, 2011

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 Replies

Form To Pop-up When Click Ctrl+shift+l?

Sep 9, 2009

I want a form to pop-up when I click ctrl+shift+l how can i do that

View 1 Replies

Prepare A Rota Application Which Changes Shift?

Aug 24, 2011

How 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 Replies

Remove Text From File And Shift?

Jul 18, 2011

I 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

Sendkeys.send While Shift Pressed?

Mar 30, 2011

I'm using the function sendkeys.send(). I'm using it in a cell of a grid because everytime I write a letter, I deactivate an activate the control, and when this happens the whole text is selected, and I want the cursor to be placed at the end of the text. In order to to this, I use: SendKeys.Send("{end}") It usually works fine, but when I'm pressing the shift key to write capital letters, it doesn't work. I've tried to send other keys with that function while pressing the shift key. If i use

SendKeys.Send("a")
I get an A, like when I use
SendKeys.Send("A")

Should I disable the keyboard input before using the sendkeys instruction, and how should I do it?

View 4 Replies

Shift Focus To Open Application?

Feb 19, 2011

I opened firefox from my VB program. the browser launched and loaded the page correctly.

When I click back into my VB application, the browser goes to the back. When I click the button that activates the browser, the browser still stays in the back.

I want the browser to move to the front or in front of my VB application window so that the user sees it instead of the application. How do I do this in my program?

View 2 Replies

Trigger TAB Key To Shift Control By Coding?

Jun 23, 2012

I am opening a web site in a vb.net 2008 webbrowser control. I want when I open the 3rd page of the web site then after the page is loaded , control focus programmatic-ly by Triggering TAB keypresses automatically by my code .

View 1 Replies

VS 2005 Capture Shift+Tab On TextBox?

Dec 10, 2011

I want to capture Shift+Tab keypress on an textbox. To do so i have used the followin code but it doesn't work

On KeyDown
If (e.Modifiers = Keys.Shift AndAlso e.KeyCode = Keys.Tab) Then
MessageBox.Show("Hh")
End If

View 4 Replies

Assigning Hotkeys Ctrl+shift+ Character In VB

Jun 5, 2011

1)I have saved some data in a text file, now I want to assign it a hotkey, so that when a user presses the hotkey (assigned by the user) that file data should be displayed in a text editor or email etc.

2) should I save the text file and hotkeys into database? if yes then how? I am totally new to program.

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved