Results for "Author: mrbobo"
Adding items to the system menu can make your application look more professional. This is a very simple example of how to do it and be able to respond to clicks on that menu. No need to vote - this is in response to a question in the discussion forum.
A PlugIn is a dll/exe/script that is installed separately from an application that can perform tasks within that application. It should be able to pass objects freely between the application and the plugin. This is in response to a number of questions in the Discussion Forums - you know, the place no-one ever goes and questions never get answered !!
Handling File Paths. The VB programmer should try to use the API wherever possible. It is usually faster and more memory efficient than most VB methods. We should also make use of .RES files rather than hard coding to reduce the amount of memory consumed by our applications. This little demo attempts to illustrate these concepts in the simplest possible way.
The use of Templates can dramatically reduce development time and time spent debugging. The repeated use of the same code means that over time, that code gets tested in many environments, and gets further refinement to produce robust code and bug free applications. This submission contains two small simple "Templates" that you are free to use. Using "ModCmnDlg.bas" means that you do not have to use MS Common Dialog Control (comdlg32.ocx) for the simple task of opening and saving files. Using "ModMRU.bas" enables the easy addition of recently used files to menus in a form. This can make your application easier for the user to use and gives a more professional feel to the application To those coders that have requested my Templates in the past - I am in the process of moving over to .NET and will release the more advanced ones over time, stay tuned !
Syntax coloring, advanced selection routines and Highlighting. Highlighting using the Richtextbox control is awkward. Whilst there are a host of Selection properties there is no Highlight property we can access from VB. We just have to parse the RTF code.
A practical demonstration of using classes to optimise your applications. Correctly written classes make your code re-usable, faster, more reliable and memory efficient. They also speed devolopment time, make debugging easier and can be placed in DLL's making them accessable from multiple applications simultaneously As time goes by they become even better because each time you use the same class in different apps, any bugs that do show up get removed for future apps as well.
There are quite a few submissions on PSC demonstrating the use of ownerdrawn menus. Most are very good, I voted for them ! However, for some folks they were a bit complex and hard to understand. I hope this helps clarify the process for less experienced coders. Most professional VB programmers have been doing this for years. This submission seeks to simplify, as much as possible, the process of converting VB menus to ownerdrawn menus. No side panels, crazy fonts/colors - just the default menu with a true color icon. This small module is a cut-down version of a template I wrote a long, long time ago. I hope I haven't introduced too many bugs in the process of simplifying it, but if I have they shouldn't be too major and the concepts involved are still well demonstrated. The tasks : 1. Locate all VBmenus on a form and determine thier actual handle according to Windows 2. Change the type of each menu to 'Ownerdrawn' 3. Subclass the form so we can respond to the messages 'WM_MEASUREITEM' and 'WM_DRAWITEM' 4. Use the API to print a caption and paint an icon, either Enabled/Disabled or Checked, in response to those messages.
Disable *.vbw files from running when you click on a VB6 Project file(*.vbp or *.vbg) in Explorer. Simple registry function to avoid malicious vbw files activating. No timers, no overhead, run once and your protected.
The Richtextbox is a great tool for displaying text but it can be quite a task converting it's format for use on the web. This project is part of a Code Library application that I still use today. It has HTML saving options for publishing source code to web sites. It demonstrates manipulation of the Richtextbox control, string parsing routines and syntax highlighting. It will also format your code applying standard indentation, remove blank lines and truncate long lines neatly, making your code much more readable. You can then choose to save it back to disk as a VB file(retaining it's original header), an HTML file or as a rich text file(rtf). Like all code this old, I would do many of the functions quite differently nowadays, but there are still some handy techniques used here. I hope I didn't create too many bugs when I pulled it out of my Code Library app ! I have had quite a few emails of late enquiring as to when I'll upload some more submissions, so in response to those here is yet another Bobo submission !
The best way to flood fill is to use ExtFloodFill. Absolutely vital functionality for graphics applications. Trouble is it doesn't lend itself for use with .NET. Your only alternative to ExtFloodFill is to use recursive routines to scan an image and change pixels colors appropriately. This can be quite inefficient and take an unreasonable amount of time to perform. There was quite a good example last month here on PSC and I've seen a good one by Bob Powel. Searching on the intenet for ExtFloodFill and .NET will return many examples of people wanting to use ExtFloodFill but I have yet to see a solution. So here it is.
Some useful routines for those just starting out in VB.NET. File handling routines, embedded resources, graphics, system icons, ownerdrawn listboxes, serialization and much more. Presented in a format familiar to those who have used my VB 6 beginners toolboxes. Source code relevent to the current tab appearing in a text box ready for copying/saving. Included in this solution are 3 other projects I did when I first obtained Microsoft Visual Studio .NET 2003. They are 3 simple clones of Calculator, Notepad and Minesweeper. I find that one of the best learning exercises you can do is to write clones of existing software. The coding strategies employed in an application are not always obvious until you come to duplicate the software yourself.
This demo shows some of the capabilities of editing RichTextBox tags to achieve very fast global formatting. Great for Syntax Highlighting etc.
This demo shows in the simplest possible code, the basics of image editing. It is intended for the novice but others may find it useful in optimising or simplifying their code. Whilst it is in no way a full blown editor, it may provide a basis from which to learn. If you want an example of a more advanced image editor I suggest you look at "Bobo Image Workshop" which is found at: http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=21482&lngWId=1
Need to test installs on different operating systems? Need a new operating system fast? Infected by virus?...Read this - it may help.
Here is the third part of my Web Browser Tricks This time as a Web Browser(nearly). What's here ? - a nearly exact clone of Internet Explorer's Favorites menu, autocomplete Address combo, menu's enabled/disabled by the Webbrowser, text resizing including identification of current size, progress bar in the Statusbar, plus all the standard WebBrowser stuff.
I keep reading requests for RichtextBox code on PSC so I decided to upload one of my templates with a few added features. Nothing that special here really - basic RichtextBox functioality. The RichtextBox is pretty good at what it does though ! This example demonstrates : Find and Replace, Infinite Undo/Redo, Using .tmp files, HighLighting selected words, Inserting Images, Inserting text at a set location with different Fonts, Common Editing Functions, Shrinking a path to a desired length, Creating your own light-weight Wizard. This is not meant to be a complete application merely a demonstation of some techniques. All error messages and bugs are provided entirely free of charge. Feel free to use any of the code or errors as you wish - MS wrote the control - I've just shown how you might use it. It's capable of more than I've shown here.
This Example Application Demonstates : Enable/Disable Forward and back Buttons, Standard Navigation Buttons, Cut/Copy/Paste/SelectAll edit functions, Auto-Complete Address Box, Saving and Loading MRUs, Avoiding duplicates in Combo/List boxes, The 'about:' Navigation method, Opening and Saving Web Pages, Using Explorers' Find File or Folder Dialog, Finding text on current page, Sizing text on Web pages, Showing a progress guage, Showing Status text, Creating HTML pages at runtime. If I get some interest via the way of votes I'll put up some more
Search a directory for files containing a specified string and return a list of such files. Once again, I've uploaded this in response to a quetion posted in the Discussion Forum.
Shows how to add items to a listview and then save those items to either an INI file or to Registry. Once saved you can then load the data back into the listview.
Another addition to my WebBrowser tricks. This one shows how to access SHDOCVW.dll so that with one line of code you can 1.Bring up Internet Explorers' Add to Favorites Dialog 2.Convert Netscape Bookmarks to Favorites 3.Convert Favorites to a Netscape Bookmark file. 4.Download files without IE throwing up its' dialog. Also I threw a couple of simple Windows based procedures... 1.Show Windows File Property Dialog 2.Show Windows Find file Dialog 3.A method of hiding the Cursor system wide.