|
-
Dec 19th, 2012, 07:49 PM
#1
Thread Starter
New Member
How to get value of checkbox
I create vb6 software to control external program since create from visual c++ how can i get state value of checkbox from external program.Please help me....
-
Dec 26th, 2012, 05:39 PM
#2
Re: How to get value of checkbox
-
Dec 27th, 2012, 12:02 AM
#3
Re: How to get value of checkbox
Code:
Private Const BM_GETCHECK As Long = &HF0
Private Declare Function GetCheckValue Lib "user32.dll" Alias "SendMessageW" (ByVal hWnd As Long, Optional ByVal uMsg As Long = BM_GETCHECK, Optional ByVal wParam As Long, Optional ByVal lParam As Long) As CheckBoxConstants
'Sample usage
Select Case GetCheckValue(Check1.hWnd)
Case vbUnchecked:
Case vbChecked:
Case vbGrayed:
End Select
How you obtain the CheckBox's hWnd is up to you...
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Dec 27th, 2012, 12:04 AM
#4
Re: How to get value of checkbox
Code:
Private Const BM_SETCHECK As Long = &HF1
Private Declare Function SetCheckValue Lib "user32.dll" Alias "SendMessageW" (ByVal hWnd As Long, Optional ByVal uMsg As Long = BM_SETCHECK, Optional ByVal Value As CheckBoxConstants = vbUnchecked, Optional ByVal lParam As Long) As Long
'Sample usage
SetCheckValue Check1.hWnd, , vbUnchecked 'Skip 2nd parameter
SetCheckValue Check1.hWnd, , vbChecked 'Ignore last parameter
SetCheckValue Check1.hWnd, , vbGrayed 'Choose only from the values presented
I leave it up to you to supply the CheckBox's hWnd...
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Dec 27th, 2012, 12:31 AM
#5
Banned
Re: How to get value of checkbox
rino is right he is double posting , no patience ?
-
Jan 6th, 2013, 08:14 PM
#6
Thread Starter
New Member
How to get checkbox value form vb6
I want to control .Net external program by vb6.Please help me to get checkbox value form external program.Thk
-
Jan 6th, 2013, 09:29 PM
#7
Re: How to get checkbox value form vb6
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jan 7th, 2013, 07:05 AM
#8
Re: How to get value of checkbox
Triple threads merged.
One thread for one topic posted in one forum section is the rule.
Do not create another thread on this topic.
Why not respond to some of the suggestions already made?
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
|