Quick Search for:  in language:    
GDI,OCX,EST,Updated,Added,checkboxoption,butt
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,052,858. lines
 Jobs: 125. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
VB6 Install Problem on large drives
By Michael P. Schieferer on 7/21


Click here to see a screenshot of this code!MagicGlob - Internationaliz ation / Globalization System for Visual Basic
By coder86 on 7/21

(Screen Shot)

Click here to see a screenshot of this code!XLS To SQL
By Bosoon on 7/21

(Screen Shot)

Using Matrices with DirectX
By Guillaume Couture-Levesqu e on 7/21


Click here to see a screenshot of this code!Play MIDI and WAV files !
By coder86 on 7/21

(Screen Shot)

Click here to see a screenshot of this code!Efficient Winsock Example
By Jordan Weber on 7/21

(Screen Shot)

Database Record Counter
By Craigénbök on 7/21


power hit keno
By Robert Justason on 7/20


Simple File Manipulation
By Kram66 on 7/20


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

LaVolpe Buttons (Updated)

Print
Email
 
winzip icon
Submitted on: 5/5/2003 12:54:28 PM
By: LaVolpe 
Level: Advanced
User Rating: By 74 Users
Compatibility:VB 6.0

Users have accessed this code 6470 times.
 

(About the author)
 
     Updated: Added checkbox/option button modes to include the diagonal buttons (Mode/Value Properties). Also included a custom shaped button that takes shape from its picture property. Some notes to mention: 1) checkbox face color intentionally made to look lighter than normal button face when Value is True. XP, Java, & Mac are best guess as to what it would look like. 2) Option button selections toggle other option buttons, but do not synchronize with VB's option buttons. 3) No change to round buttons; short of using anti-aliasing, could not figure a way for smoother look--experimenting with GDI+. 4) If compiled in app, adds 110k. 5) If compiled as OCX, < 100k using P-Code & minimal app size increase; not bad considering the common dialog is 138k. 6) No timer control used. 7) Reorganized to help follow code easier. 8) Comments welcomed, votes are up to you. Project inspired by Gonchuki's Chameleon Buttons v1.x. Last Update Uploaded: 18 Jul/1525 EST.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzipto decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
3)Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 18 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
5/5/2003 12:59:26 PM:LaVolpe
Ghost grab handles still an issue while 
in design mode. Option buttons operate 
independently of VB's option buttons. 
Please report bugs & check back 
occassionally as updates will be posted 
here with the latest date shown above 
as last line of code description above.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/5/2003 2:09:39 PM:Alain GUERIN
LaVolpe, you are the king !
Nice work, 
nice code fully commented, very nice 
idea to create CTL.
Thanks, once 
again, for sharing !
5 globes from me
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/5/2003 2:59:16 PM:Vlad Vissoultchev
don't tell me, you hit "delete 
sibmission" by accident or what 
:-))
cheers,
</wqw>
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/5/2003 3:12:51 PM:LaVolpe
Vlad, nope. The 1st post was to get 
feedback so I can finish it. This post 
adds the checkbox/option button 
functionality & I wanted it as a new 
post to advertise the update. I know I 
lost 20+ votes, but want one version on 
PSC that I can upload changes to.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/5/2003 7:10:30 PM:APATEL
I am using your control, a previous 
version of the lavolpe button control.  
I am having difficulty in upgrading it 
to the new version any idea?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/5/2003 7:49:25 PM:LaVolpe
This is a rewrite. Previous version is 
not compatible, has memory leaks, and 
has other design flaws. This version 
arose from the ashes of that version.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 12:11:20 AM:lagware
great. i gave it 5 globes. but you 
should have just updated the file to 
your other project, that already had a 
ton of votes instead of making a new 
one. some ppl might forget to vote 
again.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 1:18:47 AM:
Forget to vote for these? Never!  
LaVolpe, from a wannabe programmer 
(with apps to my credit), you are the 
King.  5 Planets
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 1:20:44 AM:Fady
Sir, I have to say, you are a genius at 
work! Keep it up, and thanks for sharing
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 3:03:53 AM:Dondata
Does this, when in XP style, use the 
users choosen theme?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 3:40:17 AM:
hey, keith! it's good that i still 
visit this site.. i never knew youmade 
a new button! it's great! i haven' seen 
any errors yet.. thanks! you get an 
excellent rating from me.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 4:11:33 AM:Broken Arrow
LaVolpe! I love you!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 7:26:37 AM:
your ctrl rocks man. i love u. take my 
5 globes as usual...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 7:44:12 AM:Light Templer
Hi man!
No more memory leaks: That 
tops ChamButton! ;)
I really! like 
the diagonal style! Great  
idea!
One suggestion: As VB5 user 
(yeah! ...) I got trouble with the two 
lines:
Tag = 
UserControl.ContainerHwnd
I subst 
with
Tag = 
UserControl.Parent.hwnd
and the Option 
button stuff works fine in a frame. Now 
I shouldn't use containers without a 
hwnd prop, but ok ... 
What do u think 
about it ?
btw: I 'm just searching 
for an anti-aliasing solution for 
'round-style' for you. Mail will come 
when successfully.
regards
Light 
Templer
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 8:46:18 AM:LaVolpe
Templer, correct. Optionbuttons to work 
properly need their container to have 
hWnd prop. Sorry, don't specifically 
design projects towards VB5 
compati-bility, although work hard for 
Win95 compatibility.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 8:47:58 AM:LaVolpe
Dondata, XP Themes? Nope, not without 
subclassing or using a timer to check 
for theme change. The individual apps 
should check for theme change & change 
the button's backcolor/forecolor props.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 8:55:39 AM:LaVolpe
Smooth round button edges. Just a note 
folks: If I go with antialiasing, every 
pixel around the edge needs to be 
blended into the parent control's 
backcolor. I can draw a circle using 
trig functions that matches the API 
quality, but the pixel count exceeds 
3000 for small buttons & >15000 for 
larger buttons. Is it worth it? Or do 
we wait for better APIs, or do we cheat 
and use a bitmap & draw over it? Hmmm...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 11:38:51 AM:Gerhard
Gr8 Stuph man... 
5 nice mars 
planets for u... 
Could you tell me if 
the button works on all ms os 
versions...? 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 1:09:08 PM:LaVolpe
Gerhard. All except maybe WinNT3.x
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 4:26:19 PM:LaVolpe
Updated>Round button depressed state & 
round option/checkbox looks much nicer. 
lv_Round3DFixed style no longer 
applicable & left in for bkdwd 
compatibility. Other issue fixed: NT, 
when in IDE, and set as default button, 
not always drawn as default.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/6/2003 7:02:13 PM:Michael Canejo
It's getting alot better. You have my 
vote.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/7/2003 5:49:31 AM:
I love all your code. 5 globes after 
this comment.
Anyway, could you please 
build two other button styles: Office 
XP Style and Transparent Style. Office 
XP Style is the most I like but not in 
your code.
Thanks alot!
TuanHai 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/7/2003 6:07:16 PM:Kenneth Foster
Talk about a control that will knock 
your hat in the creek, this is it. 5 
globes from Texas
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/7/2003 7:49:14 PM:Viktor E
Do you have any "non-5" code ? :) 
Outstanding work is your middle name.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/8/2003 8:18:26 AM:Light Templer
Sorry for posting above! Plz delete it. 
Just got your email and checked out the 
circle mod. Exactly what was missing! 
More soon ;)
Regards
Light Templer
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/8/2003 9:28:50 PM:Agung Nugroho
Maybe you should consider to add 
_OnMouseOver() and _OnMouseOut() 
events.. would be a nice gift to lazy 
developer like me! 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/9/2003 8:21:40 AM:M.C
Huiiii great. 5 globers.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/9/2003 8:35:04 AM:LaVolpe
Guys/Gals, you do have mouse over/out 
events. It is called 
MouseOnButton(True/False). Or am I 
misunderstanding?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/9/2003 1:04:11 PM:LaVolpe
Strange bug, don't know how to fix yet, 
but do have a workaround. Buttons in 
frames if multiple frames on a form. If 
VB menu option SAVE clicked, button 
props don't save, weird. If this 
happens, simply close the form vs 
Saving & button props save fine.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/9/2003 10:09:40 PM:Ron Weight
Thanks for sharing this. I appreciate 
all the work you've done. Very 
professional and very helpful.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/10/2003 12:56:49 AM:Agung Nugroho
Sorry, I didn't realize its there..
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/10/2003 3:34:52 PM:LaVolpe
Updated. Flat round borders fixed, 
borders drawn last to prevent pics/text 
from printing on borders, 
CalculateBoundingRects & DrawButtonIcon 
routines tweaked.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/10/2003 3:43:47 PM:Rott_En
Thank you for sharing this....I am 
really stunned to see such nice coding! 
5 planets from me too! keep it real!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/12/2003 5:15:06 AM:Peeter Puusemp jr.
It's great. At last I have found a 
wonderful button control. I like it 
very much, but I have a little 
complaint: the Win95 style button has 
too wide bright grey line in the left 
and top of the button. I don't like it 
very much. If it were a little bit more 
narrow then it would be like the common 
button control and it would be more 
beautiful, I think. Is it possible to 
make the grey line more narrow??? I 
will be in the heaven then and this 
control will be perfect to me. I hope 
you can help me.
With best wishes, 
Peeter Puusemp
:)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/12/2003 9:05:25 AM:LaVolpe
Peeter, in the DrawButton_Win95 
routine, replace the 2 
midShade=RGB(...) values with 
midShade=-1. This will do the trick. 
The 95 button is really based off of 
the Win98 button.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/12/2003 9:43:48 AM:Peeter Puusemp jr.
Thank you! Now this control is perfect 
for me.
This is just the best!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/13/2003 10:44:50 AM:Haru Glory
I really hate to vote you because your 
my greatest enemy in this site, but i 
can't help it. I've seen your program 
and I really love it! 5 shining globes. 
*** YOU'RE PROFESSIONAL ***
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/13/2003 11:40:16 AM:
Excellent work... What about a .net 
port?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/14/2003 7:24:41 AM:_Merlin_
La Volpe, this is just another of your 
codes to download and nurse very 
carefully. Pitty it isn't compattible 
with earlier version(s), but hey, I can 
live with that. Just a little more work 
for me ;) I'm sorry though for the 
vote... I can't give you more than 5 
balls.
Merlin is the name, and logic 
is my game...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/14/2003 8:28:59 AM:Dream
Speechless .. no wait, absolutely 
brilliant work, I missed the update. 
Amyone know where LaVolpe lives? Im 
never gonna win a prize with him around 
>:)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/22/2003 9:07:37 AM:
Excellent work... 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/23/2003 5:29:44 AM:
Please update the latest version here! 
PSC members are waiting for new release 
upload. Many thanks
TuanHai
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/23/2003 6:24:29 PM:LaVolpe
As requested. Added custom button 
shapes. Tweaked several routines & 
modified appearance of disabled images. 
ReadMe updated to include all 
properties and public functions.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/24/2003 2:47:17 AM:
5 globals again!
Thanks Lavolpe.
What 
about Office XP Styles? Have you finish 
yet?
TuanHai
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/25/2003 9:15:43 PM:
Great code man, I'm jealous of it. I 
have find something dough what most ppl 
don't now. In the declaration section 
of Form1 there is a declaration of 
variables: "Private I, J, K As 
Integer". If you Declare variables like 
that, only K is an integer, I and J are 
declared as Variant. It should be: 
Private I As Integer, J As Integer, K 
As Integer. Just to let you know. Btw 
in VB .NET is this ok.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/28/2003 5:17:40 AM:Adel D. Mendoza
I've used the previous version of this 
button and now i am using it again. I 
can't help using it again and again. 
Keep on posting man, you're GREAT!! 5 
planets for me... :-)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/28/2003 2:47:46 PM:
Well, Lavolpe. I send a mail to you, 
but you can't answer... I understand. 
My suggestion is :
1) Diagonal Left : 
Top small, Base big
2) Full Diagonal : 
Top small, Base big like a tab 
control.
Sorry for my poor 
english
Joe Kaisaka, Brasil.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/9/2003 1:18:10 PM:LaVolpe
Minor Bug. Oops #2. While creating 
non-rectangular regions (custom 
buttons), routine will fail with region 
handles <0. Fix is to replace line in 
routine NormalizeImage...
If 
bAdjRegion And rtnRgn>0 with...
If 
bAdjRegion And rtnRgn
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/16/2003 10:27:07 PM:
Very impressive. I saw yr menu bar 
usage on an inventory system! It really 
gives a new look to an usual boring VB 
interface!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/17/2003 7:39:05 AM:
LaVolpe,
Do you receive my email with 
screenshot ? Do you implement my 
suggestions ?
Joe Kaisaka
Brasil
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/21/2003 5:51:13 PM:
Very impressive. But only 1 problem: 
every time I compile it to OCX, an 
error message that says "No public 
usercontrol detected" occurs. How can i 
fix this?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/26/2003 1:53:23 PM:
LaVolpe you are king of VB programming, 
you are great and hope you continue 
your good work. Thanks for giving the 
whole world programmer to impress their 
boss / customer with this nice button 
interface!! James Thang, Malaysia, 
Kuala Lumpur.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/26/2003 2:10:22 PM:
Btw can it work in Win98, Windows Me 
and Windows 2000 Server/Professional?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/29/2003 10:33:46 PM:
5 globes from me. And LaValope I love 
how you are sticking with this. You 
should win alot of the coding contests. 
Ty for sharring with us.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
6/30/2003 10:11:41 AM:Martin Engelbrecht
Excellent...5 Globes
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/4/2003 12:31:28 PM:
hey, keith! haven't heard from you for 
quite a while!  god, this is 
goooooood!!! excelleente!!!
you get 
the highest rate once again from me! =]
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/4/2003 12:32:33 PM:
the post above was from genesia, 
okay?
=]
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/5/2003 2:43:46 PM:
Very very very impressive work.  Well 
done!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/8/2003 2:55:16 PM:LaVolpe
FYI. Those that asked questions have 
been answered off-line. If you asked a 
question & didn't get an answer; try 
again. The email address PSC game me 
for you may be bogus... :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/9/2003 8:08:29 PM:
I made the OCX from the ctl, and i can 
use in design but in run time i get the 
error '429' (can't create activex 
control), and after error '-2147287010' 
(device I/O error).
What should i do?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/10/2003 9:13:58 AM:LaVolpe
Error 429? Answered off-line. Most 
likely an OCX registration issue.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/16/2003 12:57:46 AM:
You are amazing, truely.  Not only to 
you make such amazing code but your 
support is better then MS.  You truely 
are an amazing person and you deserve 
all the praise you get. 5*
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/17/2003 3:52:43 PM:
Bug Report:  I noticed that when using 
the left-diagonal button and I minimize 
the entire midi form and then maximize 
the button does not repaint properly.  
It paints it as a rectangle instead of 
the original form.  Good work though...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/18/2003 2:16:38 PM:LaVolpe
Thanx for the bug report. Couldn't 
reproduce issue; answering offline.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/18/2003 2:23:27 PM:
I think I just found the reason for bug 
issue!
I am using the Sheridan Resizer 
control.  When this is on the form.  
The described behavior appears.  when 
its not then the behavior disappears.  
This doesn't necessarily mean this is a 
bug in your code.  Thanks for the 
support.  :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/18/2003 3:19:58 PM:LaVolpe
The above comment did identify a code 
shortfall. Placing buttons in container 
on a MDI Parent causes errors. MDIs 
have no Parent.Font nor 
Parent.Scalemode properties; fix 
uploaded here 18 Jul.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/20/2003 1:38:40 AM:
Hi, Really u r great.
no word for that 
fantastic work.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.