ParsX.com
پذیرش پروژه از دانشجویی ... تا سازمانی 09376225339
 
   ProfileProfile   Log in to check your private messagesLog in to check your private messages  |  FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups Log inLog in   RegisterRegister 

CapsLock,NumLock,ScrollLock

 
Post new topic   Reply to topic    ParsX.com Forum Index -> ويژوال بيسيك .NET
View previous topic :: View next topic  
Author Message
vahid_ve
دوست آشناي سايت


Joined: 05 Feb 2006
Posts: 85

PostPosted: Thu Feb 09, 2006 7:09 am    Post subject: CapsLock,NumLock,ScrollLock Reply with quote

چگونه میتوان به وسیله ی چند CapsLock,NumLock,ScrollLock , Command Button را خاموش و
یا روشن کرد؟
Question Question Question Question Question Question Question Question Question Question Question Question Question Question Question Question Question Question Question Question Question Question
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Thu Feb 09, 2006 10:08 am    Post subject: Reply with quote

اينو بزار توي ماژول
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
    ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As _
    Long
Private Const KEYEVENTF_KEYUP = &H2

Sub changeKey(Key As Byte, ByVal newState As Boolean)
    If CBool(GetKeyState(Key)) <> newState Then
         keybd_event Key, 0, 0, 0
        keybd_event Key, 0, KEYEVENTF_KEYUP, 0
    End If
End Sub
سه تا command button بزار به نام هاي command1 , command2 , command3

Private Sub Command1_Click()
Dim bool As Boolean
Dim keyname As Byte
bool = Not CBool(GetKeyState(vbKeyCapital))
Call changeKey(vbKeyCapital, bool)
End Sub

Private Sub Command2_Click()
Dim bool As Boolean
Dim keyname As Byte
bool = Not CBool(GetKeyState(vbKeyNumlock))
Call changeKey(vbKeyNumlock, bool)
End Sub

Private Sub Command3_Click()
Dim bool As Boolean
Dim keyname As Byte
bool = Not CBool(GetKeyState(vbKeyNumlock + 1))
Call changeKey(vbKeyNumlock + 1, bool)
End Sub
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Thu Feb 09, 2006 10:17 am    Post subject: Reply with quote

خيلي خوب بود ! مرصي .
توضيحات :
كد مربوط به محو كردن و استفاده از opacity و همچنين حاشيه دار كردن فرم و عوض كردن menu bar و متحرك كردن فرم .
Back to top
vahid_ve
دوست آشناي سايت


Joined: 05 Feb 2006
Posts: 85

PostPosted: Fri Feb 24, 2006 8:11 am    Post subject: ممنون Reply with quote

ممنون

Wink
Back to top
vahid
بي تو هرگز


Joined: 26 Nov 2004
Posts: 3067
Location: Tehran

PostPosted: Fri Feb 24, 2006 7:58 pm    Post subject: Reply with quote

منظورم اون يكي كدي بود كه گذاشتي Wink
Back to top
Display posts from previous:   
Post new topic   Reply to topic    ParsX.com Forum Index -> ويژوال بيسيك .NET All times are GMT + 3.5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum