Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing Properties of a an Option Control 1

Status
Not open for further replies.

Karl Blessing

Programmer
Feb 25, 2000
2,936
US
I have an option control(graphical style) and a command botton control that switches back and forth on visibility(thus looking like the same button, but one looking like its been depressed)<br><br>problem is if i externally set one of the options' values to true, as usual it becomes the highlighted color(backcolor) now if i manually click the option button, it becomes more of a greyed out color, how can I get it so that the button is the solid backcolor that I've chosen and not a greyed out color, also how can I make the option button look pressed down externally using properties. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
If I understand your question , your after a sticky Command button, I had a similar problem and ended up using the API<br>sort of like this<br><br>Private Sub Command1_Click()<br>Static btnState as Long<br>&nbsp;&nbsp;&nbsp;btnState = Not btnState<br>&nbsp;&nbsp;&nbsp;Call SendMessage(Command1.Hwnd , BM_SETSTATE,btnState ,0)<br>End Sub<br><br>Hope this helps<br>Collin
 
Sounds good now i just need the API declaration (and the Constant's declaration)<br><br>(One of the main reason I left VB and went to Delphi then C++ when I was teaching myself is the fact you dont need to declare the API All the time) <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML, ASP(somewhat), QBasic(least i didnt start with COBOL)
 
Sorry, here is the Declare&nbsp;&nbsp;from the VB6 API Viewer for SendMessage<br><br><b> Private Declare Function SendMessage Lib &quot;user32&quot; Alias &quot;SendMessageA&quot; (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long </b><br><br>As I follow Dan Applemans advice in his guide to the WIN32 API<br><br>I rewrote the declare into two differnt Declares to work around the &quot;as any&quot; for the lParm parameter<br><br><b> Private Declare Function SendMessageByNum Lib &quot;user32&quot; Alias &quot;SendMessageA&quot; (ByVal hwnd as Long , ByVal wMsg as Long, ByVal lParm as Long)</b><br><br>wParm : O to clear highlighting<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 to Highlight<br><br>lParm is set to zero for this windows message<br><br>and here is the constant <br><br><b> Const BM_SETSTATE = &HF3 </b>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top