|
-
Oct 10th, 2008, 11:11 PM
#1
Thread Starter
Fanatic Member
I want A can Implement press Alt+Shift
I want to change the direction of writing in textbox by using Alt+Shift Keys. so this will need every time press on these keys, so I want to insert in the texbox's event a code Can Implement Alt+Shift.
-
Oct 10th, 2008, 11:17 PM
#2
Lively Member
Re: I want A can Implement press Alt+Shift
Inside your textBox's or forms keypress event use an if statement to check if the key combination alt+shift is being pressed and if so change the writing direction inside the if.
-
Oct 11th, 2008, 12:10 AM
#3
Thread Starter
Fanatic Member
Re: I want A can Implement press Alt+Shift
-
Oct 11th, 2008, 02:23 AM
#4
Re: I want A can Implement press Alt+Shift
In the keydown event, check if the shift button is being pressed. If it is, check a boolean value to determine if the alt key was pressed just before that.
If the shift button is not being pressed, check if the alt key is being pressed. If it is, set a boolean variable to true to prime for the shift key.
-
Oct 11th, 2008, 03:32 AM
#5
Frenzied Member
Re: I want A can Implement press Alt+Shift
Yeah, Maximilian pretty much said it... A note of caution though, Alt+Shift is used as a global shortcut by the OS (it changes the current language and keyboard layout). Using it inside your application as well may result in unwanted and unpredictable behaviour.
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Oct 11th, 2008, 04:10 AM
#6
Thread Starter
Fanatic Member
Re: I want A can Implement press Alt+Shift
-
Oct 11th, 2008, 04:27 AM
#7
Re: I want A can Implement press Alt+Shift
Don't risk it, choose something else. Alt+R or something.
-
Oct 11th, 2008, 05:14 AM
#8
Frenzied Member
Re: I want A can Implement press Alt+Shift
 Originally Posted by nader
How to check ....?
Well you cannot possibly check it out under all possible circumstances... What you can do is code it and then try running the app under your current system configuration and see how well it performs (a run outside of the debugger would be preferable in my book). If it's an app for personal use only it should be enough, but if you are planning commercial deployment, a switch to a different key combination would be wiser. Ultimately, it's your call...
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Oct 11th, 2008, 10:13 AM
#9
Thread Starter
Fanatic Member
Re: I want A can Implement press Alt+Shift
I'm so sorry. I can't understand anything. I'm newbie.
Any way thank you for help!
-
Oct 11th, 2008, 11:01 AM
#10
Frenzied Member
Re: I want A can Implement press Alt+Shift
Well, are you developing the application for your own use only or do you plan on letting other people use it as well?
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Oct 11th, 2008, 12:08 PM
#11
Thread Starter
Fanatic Member
Re: I want A can Implement press Alt+Shift
 Originally Posted by obi1kenobi
Well, are you developing the application for your own use only or do you plan on letting other people use it as well?
I'm working on creating a project for store(accounting ). and it required this
-
Oct 11th, 2008, 03:06 PM
#12
Frenzied Member
Re: I want A can Implement press Alt+Shift
Well then select a different key combination, for example the already-suggested Alt+R. It doesn't matter which combination you choose, the code will not suffer major changes.
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Oct 11th, 2008, 04:17 PM
#13
Thread Starter
Fanatic Member
Re: I want A can Implement press Alt+Shift
Here is a code to implement alt+shift
vb Code:
If e.Alt And e.Shift Then
MsgBox(" change the direction of pointer")
End If
I want the inverse of that code.
vb Code:
Private Sub TextBox1_TextChanged
'implement this instead of user
e.Alt And e.Shift
End sub
-
Oct 11th, 2008, 04:50 PM
#14
Frenzied Member
Re: I want A can Implement press Alt+Shift
I am sorry, I did not understand your last post. Would you mind clarifying a bit? What do you mean by inverse of the code?
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Oct 11th, 2008, 05:11 PM
#15
Re: I want A can Implement press Alt+Shift
vb Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.KeyPreview = True
End Sub
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
If e.Alt AndAlso e.Shift Then
Me.TextBox1.RightToLeft = Windows.Forms.RightToLeft.Yes
End If
End Sub
End Class
-
Oct 11th, 2008, 06:13 PM
#16
Thread Starter
Fanatic Member
Re: I want A can Implement press Alt+Shift
 Originally Posted by obi1kenobi
I am sorry, I did not understand your last post.  Would you mind clarifying a bit? What do you mean by inverse of the code?
That code work when the user press on the keys alt+shift
inverse mean: the code must execute ( press ) the alt+shift.
-
Oct 11th, 2008, 06:32 PM
#17
Frenzied Member
Re: I want A can Implement press Alt+Shift
And why would you want to press the Alt+Shift through code? I guess you could do it with SendKeys or some direct API calls, but it's a bit outside my playing field...
Please rate helpful ppl's posts. It's the best 'thank you' you can give 
-
Oct 11th, 2008, 06:49 PM
#18
Hyperactive Member
Re: I want A can Implement press Alt+Shift
Does he want a hotkey or something?
-
Oct 11th, 2008, 07:24 PM
#19
Thread Starter
Fanatic Member
Re: I want A can Implement press Alt+Shift
 Originally Posted by obi1kenobi
And why would you want to press the Alt+Shift through code? I guess you could do it with SendKeys or some direct API calls, but it's a bit outside my playing field...
The alt+shift fix the problem of the pointer in this thread:hard question
http://www.vbforums.com/showthread.php?t=542889
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|