Results for "Category: Custom Controls/ Forms/ Menus"
This snippet creates an uneditable textbox/label whose contents can be copied to the clipboard. This is just like the textboxes in the File properties of Windows (open Windows Explorer, right-click on a file and select PROPERTIES, you'll see that several fields here can be copy/pasted although they cannot be modified). Straightforward and commented code.
Update of the Usercontrol that emulates the menubar on the side of dialogs on system using the newest version of comctl32.ocx (I think). vbaccelerator image list is now built right in through a class, so there is no need to distribute his ocx (Steve mcMahon). Header and scrolling have been added to allow for a light emulation of an outlook menubar (only one bar though). Allows changing of backcolor, forecolor(text), Header Forecolor, Header Caption, and toggling of Scrollbar and Header Visibility. Also allows for images to be loaded from file and from a STDPicture object. If you are wondering why I went to such lengths to include the vbaccelerator image list in a class wrapper?? it supports color depths up to 32 bit, try that with the normal MS image list!!. All in all a nice control with a pretty small footprint.
Application that shows you how to dynamically select skins. Lots of API calls and user controls.
jeffLabel is a replacement usercontrol for the standard Visual Basic label control. The control started out simply as a usercontrol containing two labels (for creating a simple drop shadow effect). Things got a bit more involved when it came time for the new label to be a transparent label. The solution was, while in transparent backstyle mode, for the label shadow and text to be drawn directly onto the device context of the parent control. While in transparent mode, this label demonstrates advanced usage of the DrawText API call, specifically, drawing text in any font regardless of the current font in the device context. Additionally, the GetTextFace, GetTextMetrics, GetTextColor, SetTextColor, SelectObject, and CreatFontIndirect functions are demonstrated for converting standard vb font objects into logical fonts, and device context font metrics into standard vb font objects. This is version .1 of this control, so there are some bugs I am aware of already including: transparent user controls have no .hWnd and so do not capture mouse and keyboard events (will need to subclass the parent to trap these events), when in .AutoSize mode (as the test project will demonstrate) the control has a curious effect of growing when the .Caption value is repeatedly changed (this is most likely related to my use of the standard VB controls to do the initial text sizing; this method will need to be dropped in version 1). However, despite these current bugs, if you've been looking for a label with built in drop shadow effect, or you've been trying to figure out how to create genuine transparent usercontrols in vb, this project should sufficiently jump start you on your way. =) Not many examples can be found on Planet Source Code of creating true transparent usercontrols (usercontrol.backstyle = vbTransparent), and since this certainly is still a work in progress, your comments or suggestions below would be much appreciated.
OK... not looking to blow away the world with this one, but felt lead to make the post after reading this article. http://www.planet-source-code.com/vb/scripts/showcode.asp?txtCodeId=26999&lngWId=1 At work, I have an app that is an mdi based program... and while the sub forms don't need a menu bar of their own, they do need popup context menus. Since adding even an invisible menu to a mdichild form will cause it to over write the parent mdi's menu bar, I needed a way to create menus for the child forms on the fly. This simple class demonstrates using the API calls to create a popup menu, display it, and return the item that was clicked (if any). It is simple and self-contained, but this will at least get you started on your way to wrapping the API menu functions in VB classes. I can already see I will be expanding this class, since getting this far was actually quite easy. The ultimate goal would be to "InsertMenuItem"s not just in a popup, but in the menu bar of the parent mdi form as well. I'll repost the class when I've taken it that far. (just updated to include .ItemEnabled property for the popup menu)
O.K. This is the debut of both jeffButton and jeffSplitter. =) jeffButton is a custom control replacement for the VB command button. The enhancements it provides are: location of the caption, providing for the "soft button" effect, and most importantly, automatically creating disabled versions of your button icons... just like the standard vb toolbar. However, I must state now that the API calls I use to achieve this are newer, and probably won't work in Win95 and potentially early versions of Win98 and NT. Works fine on current Win98se, WinME, and Win2K. Anyways... the controls also demonstrates the mouse capturing API calls. The button control also supports hot and disabled icons if you so wish to provide them. =) Addditionally, this project post also exhibits my custom splitter control. I think, at the least, you will find my approach unique. Again, this control demonstrates the mouse capturing API calls. You can set the splitter's orientation, and bounds. And event fires every time the bar moves, allowing you to custom resize controls at will... which is what I like to do. Most implementations I have seen of splitter controls that automatically resize controls for you aren't very complicated, or else they end up adding a lot of overhead. jeffSplitter is simply and based on Edanmo's VB5 ocx splitter controls which provide the splitter but allow you the flexability to implement your own resize techniques (useful when a frame or toolbar is resized in the same section along with a grid or treeview). =) Anyways... hope you guys enjoy my latest offering. I cut with my previous policy of distinguishing between public and private code on this project, so additionally, any of you code hounds out there will also find in this project a rich library of base vb functions and API function definitions and constants in the two files: tools6.bas and mapiconstants.bas. =) I use this module base in both work and recreation projects. If you like it or the latest controls, please gimme a vote. ;) (it don't take long to vote, honest)
This user control is my own personal replacement for the VB frame control. It more closely emulates the "panels" found in many 3rd party control libraries. It is an excellent example of using the DrawEdge API function. The control exposes 3 properties to this affect: BorderWidth, BorderEdges, and BorderStyle. The sample app visually demonstrates how these properties affect the control. In all of my personal code, I maintain 2 base modules: 1 for declaring constants and API stuff, and the other for containing generic function. Thus, the sample project includes a subset of those 2 files, plus the UserControl... and a test harness screen that allows you to set the frame properties on the fly. For the current versions of this control, or other cool controls or code, hit my web page: http://members.tripod.com/thefrogprince/ If you are not currently involved in the coding contest, I WOULD REALLY APPRECIATE YOU VOTING FOR MY CODE. Will only take a minute or two to make an account, and while it won't make me any money... =) it will encourage me to keep posting good quality code and controls like this one.
This control is my replacement for the standard VB masked edit control. It came about by my need to add a .Locked property to the masked edit control... and my utter disgust with the colors and performance of the masked edit controls available in the 3rd party libraries. For the most part, I was pleased with the performance of the MS masked edit control, but it needed some tweaking (in addition to the .Locked property). For starters, I needed an alignment property because I wanted to use the masked edit with numeric and money fields. Then, for the purpose of money fields, I wanted to be able to apply a .Format, and then programmatically block certain keystrokes (alpha characters, for instance). And referring to fields, yes, it had to be data bindable. I accomplished all of these things, while retaining the MS masked edit control at the heart of my user control. This preserved the flexibility that was generally lost in the 3rd party controls... and spared me from the much more difficult chore of trying (like other examples I have seen) to implement a masked edit control using a plain ol' text box. In my research, I came across several examples, and none had gone so far as to perfectly preserve the flexibility of the masked edit. Anyway, this user control adds the following properties to the standard masked edit control: .Alignment, .AutoSelectAll, .Locked, and .AllowedKeys (a clever and easy to enhance enum; check it out). For updates to this or other useful VB stuff, check my page: http://members.tripod.com/thefrogprince/ If you are not currently involved in the coding contest, I WOULD REALLY APPRECIATE YOU VOTING FOR MY CODE. Will only take a minute or two to make an account, and while it won't make me any money... =) it will encourage me to keep posting good quality code and controls like this one.
This code provides a relative easy way of displaying a step through wizard for gathering information. This wizard sample looks like the Microsoft Word 97 resume wizard. This code is very easy so I didn't include many comments.
It is an example how to make a popup menu using a file (popup.ini) like mIRC. This code is fully commented. I'VE ADDED SUPPORT TO UNLIMITED SUBMENUS AND SUPPORT TO BACKGROUND. I'VE INCLUDED THE SOURCE OF SSUBTMR.DLL IN THIS PROJECT. SO IT ISN'T USING DLLS. THIS IS A GREAT CODE GUYS. PLEASE VOTE FOR ME IF YOU LIKE IT. AND LEAVE A FEEDBACK.
Simple flat button control, pops up on mouse over, Preeses down on mouse down, goes flat on mouse out, includes the MouseMove, MouseDown, MouseUp, MouseOut and Click Event, Can change the picture property or have no picture at all. No timer control needed.
An ActiveX VU Meter, I hope you enjoy.
Change the appearance of a progress bar with bitmap files, I included a few sample skins. Use's the BitBlt API Function, On a usercontrol.
ActiveX ProgressBar, Meter control, No OCX, No registered controls just simple addin progressbar.
AxtiveX VU Meter.
Skinnable Meter UserControl uses BitBlt API
Vote UserControl to add to your project. Upload your code get the CodeID from the browser address string then update your code and edit your upload.
A simple and easy replication of the music match slider.
A tabbed dialog box.
MDIForm with an outlook style shortcut bar. Very Simplified.