Results for "Category: Custom Controls/ Forms/ Menus"
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.
To create an "Office-style menu" (or owner-draw menu) you must register that menu item with Windows as MF_OWNERDRAW and then process the WM_MEASUREITEM and WM_DRAWITEM messages sent to the menu's parent window. The attached project file simplifies this process by encapsulating all menu drawing operations in a class called "COwnMenu" and hiding the details of working with Windows in a code module entitled "OMenu_h." With this mini-system in place, all you have to do to get owner-drawn menus in your program is call SetSubclass on the menu's owner form and RegisterMenu to set a menu item as owner drawn. The provided example project contains complete documentation.
It's a single function, without API's, that loads an image and puts it in a destination PictureBox. If the source image is bigger that the destination PictureBox, then it will resized to fit in (mantaining the ratio). In other words, the image loaded will nicely fit the destination, but will not be deformed. If the source is smaller, then it will remain that size... This function is an upgrade (in speed, error trapping and results) of Jason Monroe original post. Thanks Janson.
Here is a Calendar Class that can be used as a replacement for the Microsoft one. No additional files have to be attached to your project, simply put calendar.cls(+two more support classes) in your project, stick a picture box on your form, write 3 lines of code, and you have a fully functioning CALENDAR with multiselect, dropdown and etc.
Among other things, this code demonstrates how to make 2 forms work together as if they were a single form. Make a form "hide" behind another and scroll down smoothly to reveal itself later. Also demonstrates how to make a custom title bar, the correct way to minimize an application, how to respond to the System Menu, and much more. It's hard to describe but it's well worth the download. Heavily commented code makes it very easy to follow what's happening. Votes and comments are appreciated!
When your form is resized, some of the controls contained there will be clipped (partially seen). This code tries to eliminate that by resizing all the controls in relation to the forms resized extent. The main routine will just have to be added at the FORM_RESIZE. Also supports MDI Forms. Enjoy!
Make the backcolor property of a form acts like a VB-Setup Program
Here you have it the source code for adding a progress bar to a listview control, similar to Napster and iMesh. I have brought the problems down to one and that is the Horizontal Scrollbar so if anyone figures this one lemme know. The code now refreshes of of the WM_PAINT message so it's super effiecient. Happy Coding!
Ever wanted to see a picture behind flexgrid text (not a single cellpicture!)? This project is a little part of my custom grid control. Picture idea was given by a questioner Experts-Exchange site. Please let me know your ideas and let me know if you want to have a more flexible FlexGrid control code. Enjoy. Suat Ozgur
It just pops down a bar when you put the mouse at the top of the screen. it then detrects whether the mouse is still on the form, if it is not it hides the little bar.
This is just a short example of how to create and use control arrays
This code causes the form's TitleBar and the form's TaskBar Window to Flash.
Add Wav Files To Your App. This sample is in .zip formatYou need a versio of Winzip to open it. You can download it @winzip.com
Changes the Ugly Standerd Look of the Form
Major Updates...Now, Picture shadow on OfficeXP buttons, easier button setup...etc.
Custom Button with resizable images. Styles: Flat,OfficeXP,WindowsXP, NoBorder Properties:Transparency,URL,Bevel,LongCaption Wrap,MaskColor... and more
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.
This will show you how to Resize Control on a Form Regardless of how many controls there are Limitations are Menus cannot be resized along with controls such as CommonDialog.
BarChart.ocx is a bar chart control for stock market/commodity markets, etc. Full source code. You can chart the open, high, low and close, the median and/or any other value you can think of.
This sample add icones in the menu of your program but not use any API. The methode is only based on Imitation, very simple but good effect.