Results 1 to 19 of 19

Thread: I want A can Implement press Alt+Shift

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2004
    Location
    syria
    Posts
    854

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

  2. #2
    Lively Member
    Join Date
    Sep 2007
    Posts
    103

    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.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2004
    Location
    syria
    Posts
    854

    Re: I want A can Implement press Alt+Shift

    How to do this.

  4. #4
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    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.

  5. #5
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    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

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2004
    Location
    syria
    Posts
    854

    Re: I want A can Implement press Alt+Shift

    How to check ....?

  7. #7
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: I want A can Implement press Alt+Shift

    Don't risk it, choose something else. Alt+R or something.

  8. #8
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: I want A can Implement press Alt+Shift

    Quote 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

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2004
    Location
    syria
    Posts
    854

    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!

  10. #10
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    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

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2004
    Location
    syria
    Posts
    854

    Re: I want A can Implement press Alt+Shift

    Quote 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

  12. #12
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    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

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2004
    Location
    syria
    Posts
    854

    Re: I want A can Implement press Alt+Shift

    Here is a code to implement alt+shift

    vb Code:
    1. If e.Alt And e.Shift Then
    2.  MsgBox(" change the  direction of pointer")
    3. End If
    I want the inverse of that code.
    vb Code:
    1. Private Sub TextBox1_TextChanged
    2.  'implement this instead of user
    3. e.Alt And e.Shift
    4. End sub

  14. #14
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    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

  15. #15
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,922

    Re: I want A can Implement press Alt+Shift

    vb Code:
    1. Public Class Form1
    2.  
    3.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    4.         Me.KeyPreview = True
    5.     End Sub
    6.  
    7.     Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
    8.         If e.Alt AndAlso e.Shift Then
    9.             Me.TextBox1.RightToLeft = Windows.Forms.RightToLeft.Yes
    10.         End If
    11.     End Sub
    12.  
    13. End Class

  16. #16

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2004
    Location
    syria
    Posts
    854

    Re: I want A can Implement press Alt+Shift

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

  17. #17
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    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

  18. #18
    Hyperactive Member
    Join Date
    Jun 2008
    Posts
    493

    Re: I want A can Implement press Alt+Shift

    Does he want a hotkey or something?

  19. #19

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2004
    Location
    syria
    Posts
    854

    Re: I want A can Implement press Alt+Shift

    Quote 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
  •  



Click Here to Expand Forum to Full Width