Important alert: (current site time 7/16/2013 2:28:41 AM EDT)
 

winzip icon

xFrame Usercontrol

Email
Submitted on: 5/11/2007 3:25:20 PM
By: Xander75 
Level: Intermediate
User Rating: By 31 Users
Compatibility: VB 6.0
Views: 25286
(About the author)
 
     ***UPDATE 11/05/2007*** Fixed issue with retrieving the expanded event at runtime ***PREVIOUS UPDATES*** Fixed the flicker issue with both the Frame text and Frame icon, Added Expanded Event, Added Click, DblClick, MouseDown, MouseMove and MouseUp Events, Added Frame Pin Button and Pinned event as per request from kibe, Fixed a small issue with repaint refreshing the entire screen, Changed some code thanks to Roger Gilchrist, Create required controls using code, Font support and Picture ability added, fixed issue with Gradient Let code. This is an owner drawn frame that comes with 4 preset colour schemes... xpDefault, xpBlue, xpOliveGreen and xpSilver. The frames have a gradient colour used for their headers and their main body. This also has a button that allows the frame to be used to hold controls and be minimised at runtime. All of the colours can be changed with different colours/gradients created at design time. This was made in a few hours today so I have not thoroughly tested it. Any problems please let me know, or any advice to make this better or maybe even add new styles let me know. The UserControl was written by myself and the module used for gradient colours was written by Mark Gordon, which I found on another site. Hope this is useful to someone... don't forget to vote if you like this xFrame.

 
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 Winzip to 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 9 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate 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
4/14/2007 6:11:31 AMkibe

very nice 'n' cool
Thank you/ 5
(If this comment was disrespectful, please report it.)

 
4/14/2007 8:40:22 AMRuturaaj

Hi! This control is really nice! I have copied the module code and merged into the user control itself. With some necessary code changes, this has given me a complete self-contained UserControl. Just one thing ... Font support is required and if you can provide support for an picture in the top-left corner then it will be a great addition. I will wait for your response on this for a while before I vote. Thanks for sharing your work with us.
(If this comment was disrespectful, please report it.)

 
4/14/2007 4:12:42 PMGoober Mpc

Thanks for your comments Ruturaaj, I will look into adding Font support and picture support also in the next few days. I want to get rid of the label that I used and print the text directly onto the picture box that I use for the xFrame header. I only used the label to quickly pull the control together.

If you have any ideas for new styles of frame then please feel free to send me some screenshots or info and I will try to create these designs into my xFrame.

The only reason I kept the module separate was because this was not my code. However I will add this into the usercontrol as you have done to make the control self contained.
(If this comment was disrespectful, please report it.)

 
4/16/2007 1:18:55 AMTheBigB

this is very nice!
maybe you could add a background-image for a new property.
(If this comment was disrespectful, please report it.)

 
4/16/2007 5:28:47 PMGenije

I have tried to load this project but it gives error "Object variable not set" !? for picHeader and all others within UserControl_Resize event.
(If this comment was disrespectful, please report it.)

 
4/17/2007 3:09:42 AMGoober Mpc

Genije, I have not been able to recreate the problem you have described. Try using the following code at the start of UserControl_Resize event: "Call UserControlsCreate". This should make sure that the controls have been created, however I didn't need to do this as this is done in the UserControl_InitProperties and UserControl_ReadProperties events which seem to work 100% for me and everyone else here.
(If this comment was disrespectful, please report it.)

 
4/17/2007 5:05:18 PMGenije

After I inserted "Call UserControlsCreate" in resize event everything went fine.
Thank you very much BTW great control.
(If this comment was disrespectful, please report it.)

 
4/18/2007 4:33:38 AMkibe

can you add button "Always Expanded"?
(If this comment was disrespectful, please report it.)

 
4/18/2007 8:31:50 PMjohn

very cool!!
could u do a version that has the buttons and the frame just like windows vista and be able to make the background of the main form transparent?
(If this comment was disrespectful, please report it.)

 
4/19/2007 2:31:33 AMRuturaaj

That's excellent! Thanks for adding Image support my friend!
(If this comment was disrespectful, please report it.)

 
4/19/2007 2:36:19 AMRuturaaj

** To kibe: set button = False and I guess that's the thing you want ... Always Expanded; because without button you won't be able to collapse it! ;)
(If this comment was disrespectful, please report it.)

 
4/19/2007 6:30:47 AMGoober Mpc

John, could you please email me a screenshot of the vista frame style you suggested so I can have a look at it. My email address is in the usercontrol code.
(If this comment was disrespectful, please report it.)

 
4/19/2007 7:12:51 PMThraka

Goober - very cool. For vista it would almost be better\easier to subclass the regular windows frame control and have it do it's drawing for you some how. :)
(If this comment was disrespectful, please report it.)

 
4/20/2007 11:19:52 AMkibe

**2 Ruturaaj,
if i click on top of frame the effect is also when i click in doublearrows right of frame. I want what click on frame and click on doublearrows are separately events. When i create array of frames, i want what first been always expanded, when i clicked on another, because this frame have event = Expanded True, else if, frame is collapse...

(If this comment was disrespectful, please report it.)

 
4/22/2007 8:02:42 AMSoeren Stroem

This is very nice code.
Is there a way, that I can detect mouseclick on the frame?
(If this comment was disrespectful, please report it.)

 
4/22/2007 10:47:18 AMGoober Mpc

Soeren Stroem I have added Click, DblClick, MouseDown, MouseMove and MouseUp events to the frame body.
(If this comment was disrespectful, please report it.)

 
4/22/2007 2:49:16 PMgibra

Excellent work, boy :-D
Thank you! 5 star by me.
(If this comment was disrespectful, please report it.)

 
4/24/2007 5:53:50 AMenmity

how about not using picHeader, but wholy owner-drawn?
(If this comment was disrespectful, please report it.)

 
4/24/2007 6:11:39 AMBill

very good. 5 from me
(If this comment was disrespectful, please report it.)

 
4/24/2007 9:16:23 AMGoober Mpc

enmity... The reason I used the picHeader was so it stays as it sounds, a Header! Without this and drawn onto the usercontrol then the controls placed onto it would be able to sit on top of the header. To me I prefer to have the control feel as though it is a frame control rather than a picture of a frame that anyone could load into a picturebox.

(If this comment was disrespectful, please report it.)

 
5/8/2007 8:59:42 AMKelvin Perez

Easy to use, lots of functions/propeties. Professional look. Everything I like in a cutom Control. Absolutely GREAT!!!
(If this comment was disrespectful, please report it.)

 
5/8/2007 7:33:20 PMLaVolpe

Congrats on winning Code of the Month for this submission.
(If this comment was disrespectful, please report it.)

 
5/9/2007 7:09:12 AMGoober Mpc

Thanks for the congrats LaVolpe
(If this comment was disrespectful, please report it.)

 
5/10/2007 9:54:12 AMenmity

hovering(in/out a few times) on the spin icon will cause flickering
(If this comment was disrespectful, please report it.)

 
5/10/2007 2:38:26 PMGoober Mpc

I will update this soon to remove the Label control and print directly onto the header itself. That will resolve the text flicker that occurs.
(If this comment was disrespectful, please report it.)

 
5/11/2007 6:43:22 AMSchuhmacher

Removeinh Picture: error 481
(If this comment was disrespectful, please report it.)

 
5/11/2007 8:13:28 AMMark

Excellent code!! A real nice control. When moving the mouse over the top bar the button kinda flickers on and off but not at the right times, like when you're over it but when your just to the left of it or moving over the icon or text. It's actually not a big deal at all but if you ever update it again, something to look at. ***** x 10
(If this comment was disrespectful, please report it.)

 
5/11/2007 10:40:34 AMSchuhmacher

If your EnableGradient=False then no longer put and GradientButton= Systemcolor gradient top = SystemColor HeaderGradientButton = Systemcolor header gradient top = Systemcolor and hereafter xFrame.Enabled = False and here after xFrame.Enabled = True to colour be the established colours
(If this comment was disrespectful, please report it.)

 
5/11/2007 3:39:18 PMGoober Mpc

FYI...

The issue described by Mark is actually the way in which the control is designed to work. It allows the user to click anywhere on the title bar to make it contract/expand.
(If this comment was disrespectful, please report it.)

 
7/19/2007 3:18:07 AMAmol Tarte

Really Beautiful Work. 5 Stars From Me!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.