406 byte By
.paul. at 2007-12-5 11:59:07
heres a hex + decimal keycodes utility (see attachment)Public Class Form1 Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyUp Label3.Text = "key - " & e.KeyCode.ToString txtDecimal.Text = e.KeyCode txtHexadecimal....
This function came in handy while I was automating some of my documentation, so I thought I would post it. It adds a space before any capital letters, so an input of "wildBill" would become "wild Bill". Private Function splitCamalCase(ByVal input As String) As String Return System.Tex...
While it is legal to access a control from threads other than the one it was created on, it is simply not a good idea. From VS 2005 onwards it is not allowed while debugging by default. Any call that accesses a control's Handle on a thread that does not own that handle will either fail or...
5622 byte By
dminder at 2007-12-5 11:46:22
For Lack of a better tool, I whipped this one together. I know I did not put all of the XML descriptions and Component details on it yet...That is all just fluff. Nice, easy control.Option Explicit OnOption Strict OnImports System.ComponentModelPublic Class LineControl#Region " Properties "...
After much searching here and on the web, it turned out that I'm not the only one who needed to be able to play individual midi notes. It also turned out that as far as .Net is concerned, there isn't that much info available.However, I managed to scrape up some bit and pieces and cobbl...
Hey all, after that very nice piece of code submitted in response to the orbiting button thread, I just finished the concept by creating a model of the solar system that is accurate, at least in terms of planetary motion. Size and distance from the sun are estimates at best.. The inclusion of e...
Dim connection As New SqlConnection("connection")Dim command As New SqlCommand("SELECT COUNT(*) FROM User WHERE UserID = @UserID AND Password = @Password", _ connection)With command.Parameters .AddWithValue("@UserID", userID) .AddWithValue("@Password", password...
I've posted a solution to this question many times already and it's come up again recently, so I figured a little CodeBank submission might be helpful. First, some background information:When you set the IsMdiContainer property of a form to True, the IDE adds an MdiClient control to y...
Hey All,I quite literally spent days trying to work out why when I exported data to excel I could not no matter what, remove the instance of excel form the task managerI tried every know method in every possible combination I could find on Google and ideas on these forums but it would not dieI d...
Core namespace classes and code:Namespace Core <Flags()> _ Public Enum ParameterUsage As Integer [Select] = 1 [Insert] = 2 [Update] = 4 [Delete] = 8 End EnumEnd NamespaceNamespace Core Public Interface IFetchDataObject Function InitializeObjec...
2802 byte By
Lasering at 2007-12-5 10:59:46
Hi!!It may have happen to you a time where u needed to use a font that is not (or normally is not) installed in the target computer. You can install it, but installing fonts slows down the system and may need restart. So I went looking (well kleinma may have helped a little) and found this link...
Many people have asked how to create an Installer in VB. So I have created VBInstaller. The installer actually extracts files from a Cabinet File, and then places them in a seperate folder. It then installs them to your system.How does it work?It works by reading a series of text files, it then...
Hi, this is one of my favorite programs that I've made. It was designed as a garage sale helper, but can also work with a small shop...<br/>60446
184 byte By
knxrb at 2007-12-5 10:16:24
I've done a sample project which allows the user to make a picture box move left and right using the mouse. <br/>It's not fantastic but hey I was bored!<br/>--<br/>knxrb
3316 byte By
Atheist at 2007-12-5 10:05:23
This code sets the parent of another window handle to any container on your form (or the form itself). You can launch a new process and stick it inside your form, or you can do it with an existing process.This example shows how to take an existing notepad process and parent set it as a child to...
1979 byte By
Merrion at 2007-12-5 10:04:43
Article describing how it works on Codeproject ( http://www.codeproject.com/useritems/MCLFormPrintControl.asp)The attached component is designed to be dropped on a windows form and it extends the controls on that form (i.e. it provides a set of new properties for the control in a manner similar t...
I've been reading up on WinAPI NamedPipes over the last month, and was lucky enough to find to find a nice example in VB.Net on the Microsoft Knowledge Base. The sample code they offered compiled and provided round trip communication between two processes, however, the values sent back fro...
10689 byte By
stanav at 2007-12-5 9:35:19
Recently, a VB forums member posted a thread asking for the code to extract a certain page from a source pdf file... So I wrote some code to do this for that member. And since splitting a pdf file involving pretty much the same steps, I went ahead and wrote these too... Hope it'll help some...
5961 byte By
zaza at 2007-12-5 9:10:22
By popular request, the code to generate random numbers in a Gaussian distribution for VB.Net. Usage:GaussNumDist(Mean, Standard Deviation, Sample Size)This will populate GaussNumArray() with the sample of numbers, whose distribution will have the mean and standard deviation specified.Code:Impor...
332 byte By
Merrion at 2007-12-5 9:01:13
This component allows you to monitor all the controls on your form and to detect when the value of any of them are changed. The demo program alters the user interface to shwo which fields have been changed but you could also use it to decide if a record needs to be saved etc...All comments / de...
3015 byte By
VBDT at 2007-12-5 8:59:27
Last updated: 09/24/2007Some times I update the component and post the updated date and the assembly version number so it is recommended to check it once a while.As all we know .Nets (up to framework 2) Time Zone class is not much of use since it only gives as objects that are associate with the...
Hi guys::wave: I am opening a new thread but actually it is to post a solution to a problem that I have been working with for the past two days and finally found a solution.I have seen this same problem asked in various threads in this forum and in others I have beeen searching. After a bunch of...
539 byte By
kebo at 2007-12-5 8:54:10
This is a simple class that basically wraps the FolderBrowseDialog and includes access to a bunch more RootFolders. The class creates a Private instance of the FolderBrowseDialog and exposes the follow properties and methods...SelectedPathRootFolderDescriptionShowNewFolderButtonShowDialogDispose...
762 byte By
knxrb at 2007-12-5 8:47:26
Created some scrolling text, can be used for news bulletins, announcements etc.You need:Label - name: label1Timer - name: timscroll - interval: 10 - enabled: true Private Sub timscroll_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timscroll.Tick If Label1.Left =...
1502 byte By
knxrb at 2007-12-5 8:47:24
I've created a slide in slide out menu for an application. This one comes from left of screen. If you want the menu on the right then changes the '.width 'for '.left' and change the '+' and '-' signs.You need: Panel - name: pnlmenu - dock: left - widt...
Often times you want to ensure that you only have one instance of a particular type of form. This is probably most common with MDI child forms, where you only want to have one instance of a child form even if the user tries to open it more than once from a button or menu item. I've often...
680 byte By
Hack at 2007-12-5 8:18:43
Attached is a basic example of how to create a Wizard in VB.NET 2005. Thanks to Atheist for pointing out the one thing I was not sure how to do and that is work with a collection of controls (formerly known as a control array.)I am using five GroupBox controls for the Wizard. I chose those...
1163 byte By
Paul M at 2007-12-5 7:42:11
I recently completed a project which required me to provide some sort of user documentation so i decided to include a help file in my project. Once you have compiled your help file, add it to your project by clicking:Project --> Add Existing ItemOnce the dialog box appears browse for your com...
3873 byte By
bmahler at 2007-12-5 7:35:04
I figured this was worth posting as I had one hell of a time getting it to work properly. This uses the Microsoft Excel 11.0 Object Library. One of the issues with using this com object was the process hanging in memory until your application closed. This solution addresses this issue.The fol...
4916 byte By
nmadd at 2007-12-5 7:18:58
You have a Form that consists of a TabControl. You'd like to navigate between its TabPages with the keyboard. You know that you can do this with the arrow keys, but you really, really, really love the Tab key and you want to use that instead. :bigyello: So, how can you catch the special Tab...
1776 byte By
bmahler at 2007-12-5 7:15:53
This is a project that I made for use as a connection interface between my .net applications and SQL server. It will allow you to easily connect to a SQL server database, update data, insert data and return data using both T-SQL and Stored Procedures. Example UsageImports BhmSoftware.DataAcces...
I created a Win Form text box, that inherits from RichTextBox, that will highlight key words. I used an interface so additional languages can be added in the future. Right now I've just done SQL highlighting. As of now the box will not do block commenting, but I'm thinking of adding...
9294 byte By
nmadd at 2007-12-5 6:19:15
There have been some posts recently regarding creating, editing, deleting and adding to XML files. I couldn't find a post in the VB.NET CodeBank regarding XML, so I thought I'd use my basic XML skills and contribute this brief post. So here are some very basic ways of working with XML...
9496 byte By
mtlca401 at 2007-12-5 6:17:34
I have a way to fake a png background for a form. I am sure other people have thought of this though it works perfect for stationary windows or splash screens.It looks like this: http://www.imagestation.com/picture/sraid225/pcec5b438b7911372475de16d0853a6a1/e89b0aef.jpgI can't upload my actu...
Hello, i've got this structure :Public Structure infor Public tx As Integer 'Coordinate Top X Public ty As Integer 'Coordinate Top Y Public bx As Integer 'Coordinate Bottom X Public by As Integer 'Coordinate Bottom YEnd Structu...
427 byte By
roiegat at 2007-12-5 5:42:41
I'm trying to get some information from a webpage internal to our company that has several frames. I'm trying to look for a specific phrase in the html code in order to get the data.The problems I run into is that when I use webrowser1.documenttext it just gives me the first frame. I...
7673 byte By
stanav at 2007-12-5 5:33:03
Hello all,A while ago I posted a little demo project that merges pdf files and adds bookmarks to the merged output file using PDFBox (see this thread http://www.vbforums.com/showthread.php?t=462929 ). However, when I recently started to use iTextSharp for manipulating Pdfs, I found a better way...
3198 byte By
stanav at 2007-12-5 5:30:22
Hello all,I was recently working on a pdf manipulating project. One of the things I needed to do was to extract the text from pdf files and search for a specific phrase. I was using iTextSharp for manipulating pdfs. While iTextSharp includes a PdfReader class, it isn't directly capable of e...
5274 byte By
dminder at 2007-12-5 5:23:41
After all the hassle I went through to figure out how to extract the URL's from an excel file I figure I had better Post this up here for others to use.''' <summary> ''' Get All of the URL's in the specified Excel File's Worksheet '...
1055 byte By
dminder at 2007-12-5 5:04:22
I was kind of toying around with a program that a customer wants that follows a theme. The only problem was that the messageboxes did not match the theme. So I created a little messagebox - it is sort of limited at the moment but it works and works well!! It allows you to set a background ima...
Create a new Windows Forms project. Add a Label, a ProgressBar and a BackgroundWorker to the form. Set the BackgroundWorker's WorkerReportsProgress property to True. Add the following code then run the project.Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventA...
There is all sorts of literature on this topic but people still keep asking the same questions. I'm creating this thread so I can send people here to look at some example code that I know will demonstrate all the principles they need. These principles can be extended or adjusted and appli...
This question gets asked all the time so I thought an example was in order.Loading an image from a database field:Dim connection As New SqlConnection("connection string here")Dim command As New SqlCommand("SELECT Picture FROM MyTable WHERE ID = 1", connection)connection.Open()Dim pictureData As...
A lot of people ask how to update a record from a bound grid using a dialogue. The process is so easy it's laughable, but most people don't realise because they don't understand how powerful data-binding is. Following are instructions on how to update a row from a DataGridView b...
2541 byte By
bgmacaw at 2007-12-5 3:45:13
In general, it is not a good programming practice to use a dialog as shown in this example but there are some circumstances when it is needed. This need most often comes up in dedicated systems, such as point-of-sale, industrial monitoring or other dedicated systems, where there may be multiple...
876 byte By
met0555 at 2007-12-5 3:31:52
this code will let you upload a file on an ftp server. working on vb.net 2005i hope it will help u ' set up request... Dim clsRequest As System.Net.FtpWebRequest = _ DirectCast(System.Net.WebRequest.Create("ftp://ftp.myserver.com/test.txt"), System.Net.FtpWebRequest)...
9113 byte By
bmahler at 2007-12-5 2:53:41
Ok, I wrote this from a php encryption function that I had. It takes a PassKey and will encrypt it with a random value each time. It is a very simple encryption but for my uses it seemed fine. I thought I would share it. I will include both the vb php versions.VB VersionPublic Class License#...
7482 byte By
bmahler at 2007-12-5 2:49:55
I had to do a ton of searching on how to do this, so I figured I would post them for others to use. These will return all the computers on your network. I am including 2 methods. One using DirectoryServices and the other using API. The DirectoryServices Method - This uses DirectoryServices t...
2063 byte By
dminder at 2007-12-5 2:49:42
This is a fairly short and sweet function that will take your datagridview and dump it into a dataset. This was created for/using VS 2005.Public Function DatagridviewToDataset(ByVal dgv As DataGridView) As System.Data.DataSet Dim ds As New System.Data.DataSet 'Take the data a...
634 byte By
AlexW23 at 2007-12-5 2:44:00
Don't know if this has been posted beforebut here is an example of how to get context menu on left click Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click Dim x As Integer Dim y As Integer x = Me.MousePosition().X - Me.Loca...