I was so amazed at how easy it was to embed google maps into a vb app I decided to post a quick example to help anyone get started. This is a simple example. Google's api has all kinds of things to help customize your map. You can find out anything you need to know from here: [url]http://code.google.com/apis/maps/documentation/javascript/reference.html[/url] You will need to: Create a new windows forms app. Add a class named GoogleControl and paste the GoogleControl code into it. Add a new html doc to the project and name it GoogleMap.htm and set its Build action to CopyIfNewer Copy …

Member Avatar
Member Avatar
+4 forum 46

Several people have asked how to export data to Excel. This code snippet shows how to export the data from a listview in details mode to a new Excel spreadsheet. Take note of the comments in the header to avoid having orphaned Excel.exe tasks eat up your system memory.

Member Avatar
Member Avatar
+7 forum 15

The present code snippet just does an especific task. This is, given an ordered sequence of natural numbers, starting at zero, generate all the different permutations there can be. When we talk about permutations, the order of the sequence does matter. So, the sequence 0, 1, 2 differs from 2, 0, 1. For example, think about a 4-7-2 lock combination sequence. Changing the sequence to 2-7-4 would not open the lock, of course. Properly speaking in mathematics, we are talking about permutations, because the order does matter. On the other hand, if the order did not matter, we would be …

Member Avatar
Member Avatar
+0 forum 9

Here's an interesting little scenario. You get challenged to a game of coin toss. Both players pick a sequence of coin toss results (heads or tails). The coin is repeatedly tossed until the sequence for one of the players occurs. The loser pays the winner a dollar. You'd assume that you each have an equal chance of winning. However, using two little "tricks" you can tip the odds in your favour. The first trick is to always choose second. If you can manage this then your strategy is as follows: Your first choice should be the opposite of your opponent's …

Member Avatar
Member Avatar
+0 forum 36

# BlowFish? # BlowFish was the brain child of Bruce Schneier back in 93. Since BlowFish was released to the public domain, Bruce Schneier has released new encryption algorythems, TwoFish and ThreeFish. BlowFish is an increddibly popular and very strong algorythem. Because it conforms to Kerckhoffs's Principal [Explained Here](http://en.wikipedia.org/wiki/Kerckhoffs's_principle), even though the algorithem is public domain, it still isn't crackable without the key. # It Isn't Mine, I Just Converted It. # I'm far from a maths genius, far, far from it. My only involvement in this class is converting from VB6 and wrapping. I have tried to comment the …

Member Avatar
Member Avatar
+0 forum 1

There are many examples of compressing files in VB.Net. So many of these examples are using third party libraries which is just not neccesarry. People were saying that files and archives exceeding 4Gb couldn't be used... I hate restrictions and decided to "Stick it to Microsoft" To get a better understanding of Zip files and their contents I set about writing my own Zip file generator from the ground up (Still using Phil Katz's Zip algorythem). Eventually I successfully built my own Zip and ZIP64 archives byte by byte. I then looked at my work and thought, now I have …

Member Avatar
Member Avatar
+1 forum 3

Hey guys, does anyone know how to do this? Here is my current code that will not work. I have tried everything that I know how to make this work to no avail. This is under form1_load. Any help would be awesome. Thanks in advance.

Member Avatar
+0 forum 0

Here is a small extention of the Panel class that allows you to 'collapse' it. So far, the user can place a control on the parent form and perform a collapse/expantion by: 'Where cpNew is a Collapsible Panel If Not cpNew.PanelCollapsed Then cpNew.Collapse() 'or If cpNew.PanelCollapsed Then cpNew.Expand() I will be changing/improving the control as much as possible. If anyone has any suggestions/tips they would greatly be appreciated!

Member Avatar
Member Avatar
+0 forum 1

I know that this probably has been done by someone, but I want to learn how to do this using VB 2010 express. I cannot seem to get the numbers to stay in the text boxes that they are dropped in. The numbers always go to the last box (#81). What am I doing wrong. You might have to change some lines to get the numbers to display in the lables assigned for them - that's ok.

Member Avatar
Member Avatar
+0 forum 5

This is the code to align the content of a Panel in the Center, Hope this Helps :)

Member Avatar
Member Avatar
+0 forum 2

VB.Net never meant for games! it's more recommended for software developement, but hey why not have some fun. If anyone out there is looking to create an Angry Birds Game-like or a Simulator for throwing an object, you've come to the right place, this code will give you great start/push to build your own app. #**Trajectory**# ![dd5f632319f6a4422579ce0a7c3db41e](/attachments/large/4/dd5f632319f6a4422579ce0a7c3db41e.jpg "dd5f632319f6a4422579ce0a7c3db41e") A Trajectory for a projectile have a bunch of formulas, the more equations you use, the more realistic motion you'll get. As a start i used only 3 formulas which they're the essentiel ones,the X and Y coordinates and the angle, containing …

Member Avatar
Member Avatar
+1 forum 2

I have just seen a resurrected thread about issues with loading images to a PictureBox and the inability to delete the file while the program is running. There was no clear explaination of the problem, only suggested hacks and apparent frustration. So I thought I would offer this explanation from [Microsoft](http://support.microsoft.com/kb/814675): > **SYMPTOMS** > When either a Bitmap object or an Image object is constructed from a file, the file remains locked for the lifetime of the object. As a result, you cannot change an image and save it back to the same file where it originated. > > Additionally, …

Member Avatar
Member Avatar
+0 forum 2

Now I am going through a project with colors. And then I think that if I try to display color values with their names in a simple combobox, it could be amazing. I tried and did it and it is looking like ![Capture3.png](/attachments/small/4/4473f7608016edcb5981090cccc80593.png "align-left") And ![Capture4.png](/attachments/small/4/87a5e5686d66033648a3e0ab787d6778.png "align-left") And finally the project looks like ![Capture2.PNG](/attachments/large/4/28adcd5b3021552683dc4fd791d2f813.PNG "align-center") In that codes, firstly I tried to bind combobox with colors. Private Sub BindWebColors() 'binding combobox with color vaues 'assign combobox drawmode cmbWebColor.DrawMode = DrawMode.OwnerDrawFixed cmbWebColor.ItemHeight = 20 Dim colType As Type = GetType(System.Drawing.Color) For Each prop As PropertyInfo In colType.GetProperties() If prop.PropertyType Is GetType(System.Drawing.Color) …

Member Avatar
Member Avatar
+0 forum 1

I am posting this in response to those who ask about replacing the webbrowser (WB) control’s default browser. You cannot ask the WB control to use a different browser, it is hardwired to use the current version of Microsoft’s Internet Explorer that is installed on the target computer. It may appear that the WB control is using an older version than is installed; this is not the case. Microsoft in their infinite wisdom made the decision to make IE 7 the default-rendering mode for all applications that use the WB control. This can be observed by visiting this website: http://detectmybrowser.com …

Member Avatar
Member Avatar
+1 forum 6

=======Download The Full Solution Below======== This will be my last VB.Net soure as I've made the move to C#. For a recent job application I was given the technical test to create a horse race simulator which would calculate the odds of a runner winning a race of up to 16 runners, then ensure the runners were within a 2% winning margin of there expected win percentage after 1,000,000 races. I got the results between 0.10% and 0.02% but never got offered the position as my solution was "Beyond Requirements". ![HRS.png](/attachments/large/4/bd6b8dd0650ce5f12fd9ab24b7755c94.png "align-center") This solution is host to ll sorts of …

Member Avatar
+1 forum 0

This snippet demonstrates how you can add VBA code to an Excel file at run time. **Prerequisites** In this snippet I am using Microsoft Excel 2013 with the Microsoft Excel 15.0 object library. Before you can use this code, you will have to change a setting within Microsoft Excel to authorise the use of the VBA Project Object Model from external programs. This is a security feature to protect end users from malicious programs and is disabled by default. If you do not enable this feature then the code below will result in an exception stating "Programmatic access to Visual …

Member Avatar
+0 forum 0

By means of Mates8, graph coding becomes a bit easier. The web page has four textboxes so the figure gets bounded to the left, right, top and bottom; and a draw button. Additionally, a panel control will contain the image generated by the code after the button is pressed.

Member Avatar
Member Avatar
+0 forum 5

This conception I get from a post on CodeProject by [Heriberto Lugo](http://www.codeproject.com/Tips/837177/Recursion-for-Beginners-Sorting-Ten-Numbers-Withou). But that was for only 10 numbers. Then I had an idea to use it in vb. There are many shorting process like Bubble Short, Linear Short etc. But exceptionally it does not use loops as others do. It does it by recursion. If we take an array of 10 elements and store a value from 10 to 1 in each Array Element. It should be like ![a09127110acb607fa3464fb2a9df79ab](/attachments/large/4/a09127110acb607fa3464fb2a9df79ab.PNG "a09127110acb607fa3464fb2a9df79ab") Let us try to go through the rotation. Consider for the first element, the stored value is 10. It …

Member Avatar
Member Avatar
+0 forum 5

Using .Net's SHA1 Crypto Service to compare hashes between a user's password and their stored hashed password. Simplez =0)

Member Avatar
+0 forum 0

I was just mucking around with a progress feature for some software, and thought I'd just put this wee demo up of a clocky type progress thing =0) Just Copy and paste the form code and watch it run. (p.s it's in degrees, note minutes and seconds) ![55f1addda67a729e91ae90c980c39deb](/attachments/small/4/55f1addda67a729e91ae90c980c39deb.png)

Member Avatar
Member Avatar
+0 forum 2

After trying to manipulate PNG files and failing miserably discovering that the standard GDI doesn't provide support for any PNG parameters decided to provide some basic image manipulation functions built into .Net that I came across on my investigations. 1. Adjust Image Quality 2. Flip Image Horizontally 3. Flip Image Vertically 4. Rotate Image (90 Degree Step) This Source Uses 4 buttons, A HScrollBar and A PictureBox.

Member Avatar
Member Avatar
+1 forum 1

Did you know that you can data bind a bitmap to a PictureBox's image property, and the source image doesn't have to be in a binary format stored in a data table? Using a standard object setup for data binding (iNotify etc.) you can easily update your program's image propertie's from one place.

Member Avatar
+0 forum 0

NOTE: The games GUI is not fully implemented, so changing it's image and difficulty is done manually in the Button.Click Event NOTE: Whether you download the VS2013 source file or copy and paste the code, you need to download, and extract the two image files to the project's "Bin\Debug" directory. If you copy and paste the source ensure your form has the following controls: Button (Button1) PictureBox (Name:pbGameBoard, Width:792, Height:792) # THE GAME # This is a fun example using graphics. It is a representation of the classic tile slide game, where you slide the tiles around to make the …

Member Avatar
Member Avatar
+1 forum 1

>Take Heed There are lots of things to be aware of with the Windows Registry. In most cases the best thing to be aware of is that ideally you should avoid playing with it at all costs. Alas, we are what we are and we do what we do. My advice to you is to make a back up of your registry. Remember though, values are read and written continuousley without our knowledge, and reverting to a backup made 10 minutes ago may not reflect your current systems settings so be careful. >Backup Your Registry Start RegEdit, Search for RegEdit …

Member Avatar
+0 forum 0

I'm currently working on a collection of sub-projects, one of which was a backup manager. I needed to be able to allow the user to specify a backup time and a repeat interval. After thinking about the solution, decided it would be best for the user to provide an Initial DateTime of the first occurance and how frequent they would like to repeat the event. This class can be used to help determaine Alarms, Reminders or anything that requires an event to be triggered at a certain time. >Fun and Good for Beginners It was good fun writing this wee …

Member Avatar
Member Avatar
+1 forum 2

Here's a simple game code, open a new vb project and copy paste this code and hit run. the game contains 3 levels, all you have to do is to shoot the smiley faces to earn money using mouse clicks, also there's a boss enemy on level 3. I didn't have much time to add more levels to the game (actually i only tried to play it once :p), here's my point of this code "Just for fun" try to import some enemy characters(in a picturebox) and add more levels and add some sound effects to the shooting or when …

Member Avatar
Member Avatar
+3 forum 8

Sometimes you want to add a little functionality to an existing class but you don't want to go to the trouble of sub-classing. A technique that you can use is known as **Extending**. For example, I frequently use regular expressions when working with strings. Wouldn't it be nice if strings supported regular expressions directly, but because they don't I have three choices: 1. sub-class the string class and add the functionality 1. write a separate function that takes a string and a regular expression as parameters 1. Extend the string class Extending can only be done within a module so …

Member Avatar
Member Avatar
+1 forum 1

every combobox selection is replaced with what a user has selected, I want it not to be replaced so that all seleced combobox can be printed

Member Avatar
Member Avatar
+0 forum 3

Here is a class I wrote to manage the MRU in a VB.Net application am writing. I did not find a build-in class in Visual Studio or on-line that did not look like a pain to use, so I made my own. While I have some 30 years of programming experience, I am pretty new to the .Net languages, so it is quite likely that I missed something that was already available in the .Net libraries, as this is a fairly common functionality, especially with the kinds of applications I write. Instructions for use are in the REM statements at …

Member Avatar
Member Avatar
+0 forum 2

Using the Load and Unload events of the Forms add these subs to handle a simple fade in and out effect. This is not limited to just one form. The subroutine definition can be added to any global class allowing the use on any form or sub-form.

Member Avatar
Member Avatar
+3 forum 6

The End.