|
-
Dec 29th, 1999, 11:35 PM
#1
Thread Starter
Member
Is it possible to assign different colors to the different items in a combo box?
Thanks
-
Dec 29th, 1999, 11:50 PM
#2
It is if you use Subclassing with the Windows API, for examples, check out my previous answers for a Colored Combobox and a Colored Listbox.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Dec 30th, 1999, 01:06 AM
#3
Thread Starter
Member
The colors work ok, but when I unload, I get a "vb 6 has performed an illegal operation".
I have the following lines in my unload event:
'Release the SubClassing, Very Import to Prevent Crashing!
Call SetWindowLong(hwnd, GWL_WNDPROC, lPrevWndProc)
Any ideas?
[This message has been edited by Andrew Herrmann (edited 12-30-1999).]
-
Dec 30th, 1999, 01:18 AM
#4
When Subclassing you need to make sure you close the Form properly, don't just hit Stop on the VB Navigation Bar, otherwise the Subclassing Release Code Never Executes causing the GPF.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
[This message has been edited by Aaron Young (edited 12-30-1999).]
-
Dec 30th, 1999, 02:34 AM
#5
Thread Starter
Member
I have a button on my form which when pressed does the following:
unload me
I've verified that my unload event is being triggered (by placing a msgbox inside of it).
Is there a different way that I should be doing this?
-
Dec 30th, 1999, 02:53 AM
#6
Did you copy and Paste the Code I posted Exactly, maybe you declared lPrevWndProc Privately and are using a Zero value, when Removing the Subclassing.
If you create a new project, add a Combobox and set the Startup Object to Sub Main and Paste the Code I posted Exactly, it will work.
If you can't get it to work, post your code and I'll take a look.
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
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
|