Results for "Category: Custom Controls/ Forms/ Menus"
This is an example on how to create borderless, resizable and skinned forms. It would be nice with some comments(and votes to;P)
This function centers a child form within a parent form (not MDI), and can be used for custom messageboxes etc... Please try and leave a comment - Dan
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.
To automatically resize an image control in a frame control to view at an acceptable size. The full image is on screen even if the image is bigger than the screen.
Ever need to see if a credit card number is valid? Well, here is your chance. I did NOT write this code, I found it on the web!! Also, this may tell you if a number is valid, not if it works
A new FlexGrid whith editing ... very cool!
Flat toolbar with VB5? Now is possible
This is a splitter control with 2 panes. I found the initial code out on the web somewhere, but it had a few bugs and was missing a few features I wanted, so I added the ability to colorize the splitter bar and the code now fires an event when the splitter is resized to allow for controls within controls to handle a resize. I also cleaned up the code and fixed a few bugs. BTW : You can add splitters within splitters to create more than just 2 panes.
Create a side bar with your logo! Very easy to use and very cool!
This is a very small function which is potentially useful for those who know where/how to use it. I used this function on several of my projects already if you're wondering if this code has any use at all. I'll post some of them later. This function also demonstrates the use of control arrays and loading objects during run-time and you'll probably learn the concept of form scaling.
Purpose:Play an AVI file through the Animation Control on the Status bar. This code was inspired by James E. Toebes’ code: "Progress Meter on Status Bar"... instead of the ProgressBar control I am using the Animation Control. There were a few things I tweaked. For more AVI files you can check out http://pjs-inc.com/vb-avi
This code will change the color of the "Blue Screen Of Death"
Notice: THIS CODE HAS BEEN FIXED! PLEASE READ THE COMMENTS AT THE BOTTOM OF THE PAGE TO SEE WHAT WAS WRONG BEFORE. Create real C++ style command buttons with ONE line of code!!! You can use this code on any of your commands buttons. You will loose any images and the BackColor of the button, but that really doesn't matter because you can 'paint' images onto the button using the API. Make sure you set the style property to 'Graphical' or this will not work!. OK here is how it works. You see, by default Visual Basic's command buttons are drawn with the 'Default Push Button' style, which makes them flat and ugly when pushed. But when you set the style to 'Graphical' its really just a C++ button with a single pixel outline drawn around it. This code basically just stops the button from drawing that line to create a sunken style button. This code is not compatible with Visual Basic 4.0/32 because its buttons don't have the style property. However, in Visual Basic 4.0 you can apply the code to an option button and it will appear as a C++ push button (they both have the same basic events and properties: Click, MouseMove, etc...) which is a 'rigged' kind of way of getting it in to Visual Basic 4.0...hehe. I wrote this code because I got tired of all the people trying to create C++ style buttons with CreateWindowEx and Message Hooks, and all that other difficult stuff.
This ActiveX allow you to use animated gifs in your applications. I saw examples of modules before but not ActiveX.You can make OCX file from this and use it in other applications.
Places a Progress Bar in a Status Bar, with Windows Common Controls 6, without any third party OCXs or API.
I have been tinkering with the Windows API AnimateWindow function, and have wrapped it into a user control, which you can drop onto any top-level window. You simply call the controls CloseAnimation method from the form_unload event, and your window will roll or slide up, down, left, or right, or fade or zoom to nothing. This easy to use control has 2 main properties - the "AnimationEffect", and the "EffectDelay". The included example project here shows how easy it is to use. It seems that this API Function exists in Windows 98, ME, 2000, and XP (I was unable to get this to work with Windows 95 or Windows NT). I got varying levels of effectiveness depending on the OS. Keeping the EffectDelay to a minimum (500 or less) usually produces great results. This project has the default delay at 1000 to exagerate the effect, but you should set to 400 or 500 in your projects. Use the "Project1.vbp" to see the example, or include the CoolAnimate.ctl in your project to just use the user control. Hope this is helpful to some of you.
Here it is! Want to enter only numbers in a textbox? Or only currency? And avoid users paste something that is not valid? Try this! This is a class module that lets you turn a standard textbox into a new one, that accepts only numbers (also decimal). The decimal and currency separators depends on the locale settings, and are read via API! New features added also!! Check it out!
This is an Intellisense PopUp I'm working on for a project. It uses an XML data file to get the methods for the object, which allows this to be completly customizable for any language or what ever. Note that the example project is just that, an example, and in no way is it the 'perfect' way to popup the list. I am still working on this but wanted to post it so you could use and build off of it. Let me know what you think. I am also working on support for More then 1 level ( ex. Me.Controls.Blah) also if the select item is an object or can equal a boolean value it will load those methods as well. But I'm still working on that. I have included a sample methods file called defs.dat, which is the default filename for the control, but you can change it. *** Update *** Now uses ListView to allow Images. Fixed a couple bugs too. Added Ability to use up and down arrows to select. *** Another Update *** Now supports Popups for other object (see screen shot) *** Yes, Another Update *** Mainly an update of the defs file. I added some more objects to it and changed a few things in it. Fixed a couple little bugs in the example program for gettitng the Intellisense to popup. Added support for different types of methods, three as of right now (Sub/Functions, Properties, Others like Boolean Values). **** Why Look Another Update **** This time I've added an OnError Event that will allow you to capture any error that occurs. Flatscrollbars, Custom Visible Items, Custom ForeColor, Custome BackColor, GridLines, Remove or Show The shadow, Hover Selection, HotTracking. See the Screen shot for examples. **** Heres another Update for you ***** This time around I added the ability to a Use your own Images with out adding them to the image list within the control. You can use an external Image list or even Load the pictures from a file. And Just set up the defs.dat file in the "img" attribute to have the 'key' that you supply to add the image and Viola (see screenshot and demo app for example). Also added a few other properties like: ListIconCount (returns total images), ListIcon (returns the image)Add And Remove Items from the list, Add and Remove Images. Thanks to all of you for the votes. Watch for more updates.
This is a wrapper class that allows you to set minimum and maximum sizes of a form. Never do again checks on the Form_Resize() event, that flickers! This one uses APIs calls to set maximum and mimimum sizes. Four functions calls are needed in the form. I had a look into PSC, and I found nothing similar to this. Have a look at it, and leave comments! Parts of these code are from www.vbaccelerator.com, but this is easier and much better.... :-)