Click here to Skip to main content
15,897,371 members
Everything / Programming Languages / Visual Basic 11

Visual Basic 11

VB11

Great Reads

by Niemand25
A simple way to place any ObjectListView inside a ComboBox
by Thava Rajan
Copy and insert data at any postion in your datagridview
by Thava Rajan
This tip is used to fix a workaround for a bug in double click on checkbox
by Chris Jorna
Communication Library Files - NetTools | IsSameSubnet

Latest Articles

by Niemand25
A simple way to place any ObjectListView inside a ComboBox
by David Vanson
Generate you own barcodes for your business, Promotional items or to share links with friends.
by Terence Wallace
The primary purpose of this article is to provide quality sample source code for VB.NET developers interested in building data-centric applications using the .NET Framework.
by Chris Jorna
Communication Library Files - NetTools | IsSameSubnet

All Articles

Sort by Title

Visual Basic 11 

2 Aug 2016 by ProgrammingEnthusiast
i have created an application that runs in background. when i minimize it, it will appear on the task bar. it is working fine, but when i turn off my computer, windows says that my application is blocking the shut down process. how do i close my application when i shut down my computer? i...
2 Aug 2016 by Kornfeld Eliyahu Peter
There are certain talks (messages) between the Os and your application while OS try to shut down...OS actually sent a WM_QUERYENDSESSION to your application, but as you didn't handled it it got a false response, marking your application as blocking...Read this paper, to see how prepare your...
2 Aug 2016 by ProgrammingEnthusiast
i have already resolved it by adding this code during form_closing event of my main form.If e.CloseReason = CloseReason.WindowsShutDown Then Me.Dispose
2 Jul 2014 by Keith O. Williams
I have a ping pong game that I want to connect to a classic ping pong game, however I don't know who to connect the two together. How do I add menu items on the form for the bold sections of my code?Here is the code (I hope I done it right): Public Sub New() Title =...
10 Jun 2014 by Thava Rajan
This tip is used to fix a workaround for a bug in double click on checkbox
22 Jun 2015 by Terence Wallace
The primary purpose of this article is to provide quality sample source code for VB.NET developers interested in building data-centric applications using the .NET Framework.
20 Mar 2020 by Member 13358124
I try to write codes to get the correct font size that fits to the given box. Here I gave New Rectangle(0, 100, 100, 100) as a new new rectangle. But sometimes it dose not give the correct font size when there is two text lines in the box. Help...
20 Mar 2020 by Ralf Meier
The following Code shows you a method (written by me) which calculates the possible Fontsize for a given Size - I think you can easily change it to a Rectangle : Function GetFontSizeMatch(ByVal myText As String, ByVal myFont As Font, ByVal...
10 Jan 2016 by David Vanson
Generate you own barcodes for your business, Promotional items or to share links with friends.
19 May 2022 by Member 3892343
I have an application in VB .Net that connects to a database MS SQL. It is connected to a datagridview, the problem is when I add a new record when I update the dataset it accepts the 2 first cell values but the third cell becomes blank, if I...
2 Nov 2017 by Rabee Qabaha
i want to change the backcolor for buttons depends on information from database, i have form has multiple buttons like this picture bellow. I have a database table for shops (stores),There is a column in this table that contains the shop number and a column for its status : Yes or No (if rented...
2 Nov 2017 by Mrunal Sonawane
Hey... I made my own database and imported that database to Visual Studio using the DataGridView control... Do the same and then use this... Public Sub ExecuteColoring() Try Dim numberRows As Integer numberRows = DataGridView1.Rows.Count - 2 'We...
6 Sep 2014 by Member 9947756
VB-2010 - Need to change the font on the axis title. Looks like it is straight forward as a simple property in the axis collection. But every time a change the value it reverts back to the default. Label fonts changes work but not the title fonts. Is there something else that must be set so...
17 Feb 2015 by Harindra Shivam
HiMy Application is built in MS Access. Now I want do the code coverage for the application. so is there any tool present to find the code coverage for VBA application ????
15 Apr 2015 by Chris Jorna
Communication Library Files - NetTools | IsSameSubnet
28 May 2014 by Thava Rajan
Copy and insert data at any postion in your datagridview
13 Dec 2014 by Rockford Sol
HelloI am looking for a solution to my little problem. I have various windows applications, all applications. I want to have a common windows service to provide some basic support to all these applications.I am new to Windows Services, but I think a windows web service is solution to my...
13 Dec 2014 by Zoltán Zörgő
This is not a "quick answers" kind of question. It seems, that you haven't tried anything on your own. This is now how it works here, we won't do your job. But here is some guidance:1) VS Express has no Windows Service tempalte. SharpDevelop has. But VS is more convenient to use than SD....
6 Oct 2015 by Demon Slayer
I need some help from you guys, because i'm completely blocked.I'm Using the following code, to change the value of the field, but don't know why the database is not updating. I'm using SQL SERVER 2012 and Visual Studio...
25 Jun 2016 by Sh.H.
Hi guys,Is it possible to deactivate all or any of system events?What I have tried:I tried to find something on the net, but no luck!
24 Jun 2016 by Dave Kreskowiak
That depends on exactly what you mean by "deactivate a system event".At face value, no it's not possible to turn off the raising of a system event.You can, however, just not subscribe to the them. If you don't have a handler for the event, nothing happens in your code when the event is...
25 Jun 2016 by Patrice T
Quote:Is it possible to deactivate all or any of system events?'Desactivate' is a bad idea.The OS handles system events, but don't 'Desactivate' them. System events are here for a good reason, just desactivate them is weird.I suspect you try to do this as a solution to another problem that...
30 Jun 2014 by Keith O. Williams
I am making a Bejeweled game in Visual Basic Professional 2010 (which is apart of the web browser known as Scoontz) and I stumbled across an error when trying to draw a sprite: DrawSprite is not a member of Scoontz.SpriteHere is the code (with the line in question in bold): ' Note...
8 Nov 2016 by Niemand25
A simple way to place any ObjectListView inside a ComboBox
4 Aug 2014 by Member 10455176
Hello guys help for a beginner.How to enumerate CodeElement inside the body of a function?thank youI want to try to write an addin that can write a Select Case of an enumerated variable inside a function.I tried with this code with Visual Studio 2010 : Imports EnvDTE ...
19 Mar 2020 by Member 13358124
ant test1 test2 test3 ...
19 Mar 2020 by Maciej Los
Check this: string xcontent = @" ant test1 test2 test3 ...
5 Feb 2015 by RAFAH SAMIH
I want to determine the size of header packet in mpeg4 it always begin with 00-00-94-08 the first packet in frame 00-00-A8-08 the second packet 00-00-b7-08 the the last packet is the packet have only 4 bytes ?
28 May 2014 by Member 10315630
How could I clone a VB Solution like:A Visual Studio Solution Cloner[^]this?Thanks for all
28 May 2014 by OriginalGriff
Don't post this under Quick Answers - if you got the code from an article, then there is a "new message" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.Posting this here relies on them "dropping by" and...
9 Mar 2023 by Michel van der Laan 2023
I have an unzipped xlsx document that consists of two xml documents, sheet1.xml and SharedStrings.xml. Both have a xmlNameSpaceManager : Dim workSheetManager As New XmlNamespaceManager(workSheet.NameTable) ...
1 Dec 2014 by Member 11264383
heres my code so far: Option Strict OnPublic Class fmResurface Public Const dblWoodFlooring As Double = 5D Public Const dblCarpetFlooring As Double = 3D ' This class variable doesnt change and is available througout app' Dim dbldefaultWoodcost As Double Dim...
1 Dec 2014 by Member 11278242
Friend.....i think you use new verbs (Hello,the, to ,...etc).which have no identity into the visual studio..so if you want to add these words..you hv to create a new collom nd write a new code .. LYK..lbloutput.tet="txthello.text+ +txtfirstname.text+ +txtlast.text";
1 Dec 2014 by DamithSL
try like below Dim SumOfTotalCosts As Double = lbTotalCost.Items.Cast(Of Double)().Sum()
18 Aug 2014 by ehabelnahas
Hi all,I need to connect my Visual Studio LightSwitch with VB.NET project to SQL database which is located on a shared drive on a local network .. Database Name is: Proj2014DB.mdf The PC name containing the DB is: PCNO10Drive on PCNO10 containing the...
18 Aug 2014 by Eldon Elledge
Provided that the PC that the Proj2014.mdf is located on is setup to properly run SQL Server (or Express or LocalDB), include the PC Name (or IP Address)\ SQL Server name. See below:Data Source=PCNO01-PC\SQLEXPRESS;Initial Catalog="Proj2014";Integrated Security=True;Pooling=True;Connect...
18 Aug 2014 by Eldon Elledge
It will need to be installed on the PC that has the database file. Based on the needs, there are different versions to look at:LocalDB - on a local PC - Great for Developing and TestSQL Express - Great for light use across the network with a few users.SQL Server - High-End use
30 Jul 2020 by OriginalGriff
Step 1: Learn Python. Step 2: Learn VB Step 3: Use the Python code as a specification for a new VB app. Never convert languages, it doesn't produce good code in the target language because it uses a totally different framework, and the data...
30 Jul 2020 by Member 14903326
i need to convert this code to visual basic for a proyect that i did not know that was to be in viasual basic form and to be honest i don't have much time so if anyone can help me that could be amaizing What I have tried: #Se muestran los...
17 Oct 2014 by Member 11155542
Hi All, new to VB and learning, liking it :). I would like to create a folder in VB from a textbox input e.g. I have one "browse..." button, a "textbox1" and a "create folder" button, I want to create a folder from browsing to the file system location where the user would like to create the...
17 Oct 2014 by Member 11155542
I dropped the folder checking and went for the simpler code: Thanks Sanisa Private Sub Browse_Click(sender As Object, e As EventArgs) Handles Browse.Click If (FolderBrowserDialog1.ShowDialog() = Windows.Forms.DialogResult.OK) Then TextBox1.Text =...
19 Oct 2014 by Member 11155542
This is what I've come up with: Dim txt As String txt = txtFolderPath.Text If CheckBox1.CheckState = 1 Then My.Computer.FileSystem.CreateDirectory("" & txt & "\test") MessageBox.Show("test folder created successfully, click OK") End If
3 May 2018 by Prashant9813
Hello I am Developing A web Browser. And I have Tested That browser on facebook and Google It worked Perfectly but whenever i open Flash like SWf games From this Link :- Y8.com Then It stopped Loading . Just Ads Pop Ups. Anybody can Help Regarding This Problem. What I have tried: I Have...
26 May 2018 by User 13023712
Till now, I have made a pretty advanced rich text editor. However, is there any possible way with which I can make the Richtextbox multi-paged? ( sort of like Microsoft Word ). PS: I am using a custom Richtextbox to support printing. Thanks! What I have tried: I tried using panels to white...
26 May 2018 by OriginalGriff
No. The standard RichTextBox control is really very basic - there is no way to "extend" it to multiple pages. It may be that you can find a "better" rich text box - try Telerik and DevExpress, they both have extended RTB's though I haven't tried them. The other alternative is to write your own...
30 Dec 2014 by okanarslan20
Hi guys, i want you tou ask question :) for my application i need to know how to i use htmlagilitypack so i want to get temprature data from tihs url(https://www.google.com.tr/webhp?hl=en&tab=ww&gfe_rd=cr&ei=UrWiVJGeDKuz8wf1moCQBA#hl=en&q=weather+Ankara) but the error "object reference not set...
17 Mar 2018 by faiqaa
The form allows me to save customer details in a text file when the button "save" is pressed, I am also carrying a presence check and a length validation of the phone number inputted in a text box every time the user presses save. The problem is that when the validation fails the customer...
16 Mar 2018 by ATeDe
Hi j snooze I think, this is what you might looking for? I'm not very familiar with Forms and all that jazz in VB.NET, also tomorrow we have St Patrick celebration here in Ireland, so I wrote quickly this piece of code. txtBoxes array of string simulates content of your real TextBoxes. This...
17 Mar 2018 by ATeDe
Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ' Button to validate Phone numbers typed into TextBoxes Dim emptyTextBoxes = From txt In Me.Controls.OfType(Of TextBox)() ...
24 Jul 2018 by Member 13824773
Trying to avoid booking a lesson twice on the same date and same time. got this code from youtube but it's not working for time. If i change to @name or something other than time it will work. please help What I have tried: Imports System.Data.OleDb Public Class Form1 Dim myconnstring...
24 Jul 2018 by OriginalGriff
Start be reading the code and working out what it does, and how it does it. It's fine and dandy to find code on the internet, but if you don't want it to do exactly what it did in that application, you will always need to modify it to suit your needs. And that means understanding how it works,...
24 Jul 2018 by Jochen Arndt
What is TimeDateTimePicker? If that is a DateTimePicker Class (System.Windows.Forms)[^], use TimeDateTimePicker.Value to get the value as DateTime object. Note also that TIME is a reserved word and must be therefore enclosed by square brackets when used as field or table name (which should be...
1 Mar 2018 by faiqaa
In my Login form the user needs to input the username and password in the relative textboxes and then press the button LOGIN. The username and password are already saved into a text file, every time the user tries to enter the username and password entered by him will be matched with the ones...
1 Mar 2018 by Richard Deeming
Don't encrypt it; hash it. Secure Password Authentication Explained Simply[^] Salted Password Hashing - Doing it Right[^] Generate a random salt for each password; append (or prepend) it to the password bytes; then generate a one-way hash of the password. Store the salt and the hash in your...
1 Aug 2016 by JU571C3
Hi, i need help to get the file name without the full path here is the code i did but is not working.Please help. filelist.Items.Clear() Dim fileinformation As FileInfo For Each files In Directory.GetFiles(path) fileinformation =...
1 Aug 2016 by Dave Kreskowiak
Path.GetFileName Method (System.IO)[^]Give this method the fully qualified path and it'll give you just the filename portion.
1 Aug 2016 by ProgrammingEnthusiast
filelist.Items.Clear()Dim fileinformation As FileInfoFor Each files In Directory.GetFiles(path) fileinformation = files filelist.Items.Add(fileinformation.Name.ToString.Replace(fileinformation.extension,"").Trim)Next
2 Dec 2016 by Member 11328325
my codeImports System.Data.SqlClientImports MySql.Data.MySqlClientImports System.IOPublic Class ADD1 Dim conn As MySqlConnection Private imagename As String 'this code declare variable as Byte Private imagge() As Byte 'this code declare variable as...
2 Dec 2016 by $*Developer - Vaibhav*$
C# ADO.NET SqlCommand - ExecuteNonQuery[^]
9 Jul 2016 by Sh.H.
Hi guys,Is it possible to make a virtual display, and then turn the display from my graphic card to that virtual display?(The monitor will be black then. Or maybe it turns off)What I have tried:I have tried nothing until now.
9 Jul 2016 by Dave Kreskowiak
This requires writing a Remote Display Driver[^].I hope you're into C and debugging kernel drivers because you're not going to be writing this in VB/VB.NET.
6 Feb 2015 by bilalali
Hello Everyone I want making the button if click the button show the output file who I worked in This Example
29 Dec 2015 by Member 12164472
i would like to make a task by visual basic start when windows start
29 Dec 2015 by ZurdoDev
A simple google search shows this post that has several options, c# - Creating Scheduled Tasks - Stack Overflow[^]
29 Dec 2015 by Sergey Alexandrovich Kryukov
Please see my past answer: Windows Services - problem with operating system[^].If you are talking about your own Windows Service, please see my past answers:Walkthrough: Creating a Windows Service Application in the Component Designer[^],Windows services Error[^],Configure Windows...
2 Mar 2018 by faiqaa
I am trying to display a message box based on the quantity regarding certain products saved in rows of data (4th item) in a text file, I know how to read each row but not how to only read a specific item.Does anyone have any idea? Let me know,thanks in advance. Below you can see what code...
2 Mar 2018 by OriginalGriff
You can't read "a specific item" from a text file, because it doesn't have any implicit order - in fact even lines are just an interpretation of characters within the file: each time a newline character (or character pair, depending on the operating system) is encountered, that is the end of the...
4 Jul 2017 by Member 13293441
i want to print label with label_id label id format contain running number which is 0001 (0001,0002,..) -i want to reset the running number to 0001 when the new day come. can someone give me some ideas or solution regarding my problem? currently, my system reset the running number if new day...
4 Jul 2017 by OriginalGriff
Start by adding two columns to your Table: The first is an INT IDENTITY column called Ident, autoincrementing by one The second is a DATE column called InsDat which defaults to GETDATE() Then when you want the rows with a daily sequence use this: SELECT m.Ident, m.InsDat, m.OtherColumnList,...
2 Mar 2018 by faiqaa
This form allows me to calculate the monthly average when I click the respective button, I want to be able to calculate the average display it in a label and then save this value into a text file and when calculating another average I want to be able to display the previous value calculated...
2 Mar 2018 by RickZeeland
You could try something like this: File.WriteAllText("C:\Users\Windows 7 User\Desktop\Average.txt", "blahdiblahblah") Dim value As String = File.ReadAllText("C:\Users\Windows 7 User\Desktop\Average.txt") See: File.WriteAllText Method (String, String) (System.IO)[^]
2 Mar 2018 by faiqaa
I am saving stock info such as product ID,Product name,price and quantity. I want to be able to sort by product ID using a bubble sort. I am first loading the data into the list box from the relevant text file and then sorting. I have tried using the one below but it doesn't not seem to...
2 Mar 2018 by Richard MacCutchan
StringBubbleSort(arr) You have not defined that subroutine anywhere.
1 Jun 2017 by yogesh vaidya
hi, i am trying a open file dialog to bring a excel file in my program in run time but err comes "be shure about query string and memory " OFGESelectfile3 is renamed open file dialo and filter is JPEG Files| *.JPG|GIF Files|*.GIF|Windows Bitmaps|*.BMP|Excel fiels|*.xlsx What I have...
1 Jun 2017 by Dave Kreskowiak
Wait a second. You're trying to get a PictureBox control to load an Excel workbook as an Image? Yeah, that's not going to work. The PictureBox control has no idea what to do with an Excel workbook. If you're trying to show an Excel sheet in a Windows Forms Form, it's considerably more...
19 Sep 2023 by Jim Harrison 2023
Server logs: Quote: 15:14:08:Operating System: Windows (Microsoft Windows 11 version 10.0.22621) 15:14:08:CPUs: 12th Gen Intel(R) Core(TM) i5-1235U (Intel) 15:14:08: 1 CPU x 10 cores. 12 logical processors (x64)...
17 Sep 2023 by OriginalGriff
This would be better posted in the dedicated forum: CodeProject.AI Discussions[^]
25 May 2015 by QuentinEllison19
hey...hi!!!actually the thing is that i'm new to vb and i'm working on 1 project..just for fun.n i am stuck..means i can't upload means edit the access database with vb6.0here is the thing rec.Open "insert into Payment values ('" & Combo1.Text & "','" & txtTa.Text & "','" &...
25 May 2015 by OriginalGriff
First thing: check your data.Because you don't list the columns you are trying to INSERT into, Access assumes that you want to insert data starting from the first column - so if you have an automatic ID column at the beginning - and it's very common - the INSERT will fail, because you aren't...
25 May 2015 by QuentinEllison19
it's good to have you..i need to update no insert..can you help me with that???con.Close con.ConnectionString = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C:\Users\Public\Documents\SAMPLE.mdb" If con.State = adStateOpen Then con.Close End If con.Open ...
26 May 2015 by Slow Eddie
I think your problem might be that the connection is using adOpenStatic.try adOpenDynamic. this should allow you to read and write.Also go to help files and look up "Fields" and "recordsets"Hope this will help
26 May 2015 by Maciej Los
You have to use ADODB.Command[^] together with Execute[^] method to update your data.For further details, please see:Using ADO with Microsoft Visual Basic[^]ADO Code Examples in Visual Basic[^]How to Reference ADO 2.0 in Visual Basic[^]
27 May 2020 by Member 14841900
Dim TDate As Date Dim Batch As String Dim Product As String Dim Code As String Dim Material As String Dim Quantity As String For i As Integer = 0 To DataGridView1.Rows.Count...
27 May 2020 by Patrice T
Quote: I get problem index was out of range. Error message also tells you the position of error (line number), it helps to spot the problem. Are you sure that DataGridView2 have at least same number of rows than DataGridView1 ? For...
22 Dec 2015 by CHill60
Firstly - anything that is intended for logging keys, grabbing passwords, hiding from Antivirus is intended for malicious purposes. That behaviour isn't just prohibited here but on all reputable sites. You will get no help with it.Secondly - you said that your teacher asked you to make a...
1 Apr 2015 by serkanguncan
Please click on the pictureClick for sample picturestopic = translate.google.com clicks I added one form LinkLabel LinkLabel1.Text = WebBrowser1.Document.GetElementById("spelling-correction").InnerTextI do not have click here
31 Mar 2015 by AnotherKen
Maybe this will help? Mouse and Keyboard Tracking and Simulator[^]
6 Jun 2014 by santoshsasane
Hi All Master Minds,I have problem with IE 8 Browser after 10 to 15 min, my Application menu bar not exciting. I have try a lot to solved this, please help me on this. Application Develop in .net VS 2010.
6 Jun 2014 by Awadhendra Tripathi
Update your windows or update your IE( may be some patches are missing)orJust Uninstall your web browser or format your machine. :)
15 Jun 2015 by babero
I'm using Edraw Office Viewer to embed microsoft office in vb10. There's no problem in opening, saving, creating a new document but i want to load a document in the edraw office viewer instead of opening a dialog box and locating the document manually. I already stored the path of the document...
21 Mar 2018 by faiqaa
I am using a total of 7 text boxes, six of them are named txtBox1,txtBox2,txtBox3,txtBox4,txtBox5,txtBox6, the seventh is named txtBoxSearch,I have tried using the code below to carry out a presence check, the problem is that I only want to carry out the presence check on the first 6 text boxes,...
21 Mar 2018 by Maciej Los
If you would like to get a list of TextBoxes, which name is txtBoxN (where N is a number) and TextBox is not empty, then try this: Dim pattern As String = "^txtBox\d$" Dim r As Regex = New Regex(pattern) Dim notEmptyTextBoxes = Me.Controls.OfType(Of TextBox) _ ...
9 Dec 2016 by AndreaP92
Hello, i'm using two listview in "Detail" mode.cause i'd like to do something like this| HELLO | WORLD | HI | --- Listview2| Ch1 | Ch2 | Ch3 | Ch4 | Ch5 | Ch6 | Ch7 | --- Listview1| etc.| ... | ... and i want be able to resize each column from each listviews....
9 Dec 2016 by Michael_Davies
Try either method:Private ListView1Changing as Boolean = falsePrivate Sub ListView1_ColumnWidthChanged(sender As Object, e As ColumnWidthChangedEventArgs) Handles ListView1.ColumnWidthChangedif ListView1Changing = false Then ListView1Changing = true Ch_hello.Width =...
9 Dec 2016 by AndreaP92
Solved like this thank you Michael. Private ListView2Changing As Boolean = False Private ListView1Changing As Boolean = False Private Sub ListView2_ColumnWidthChanged(sender As Object, e As ColumnWidthChangedEventArgs) Handles ListView2.ColumnWidthChanged If...
28 Dec 2014 by Pritam Deshmukh
This tip elaborates few useful tricks and shortcuts of VS 2013 mainly for professional edition (You can find them with Ultimate version too).
26 May 2012 by drummerboy0511
Hi there.I'm trying to build an app with VB.NET in Visual Studio 11 Express Beta in Windows 8. I tried using the My Namespace, and instead of ending up with code that worked, it didn't recognize the My Namespace. Is there a way to get this back?Thanks!-drummerboy0511
9 Jul 2014 by Keith O. Williams
While debugging a game I was thrown with a System.NullReferenceException Error: Object variable or With block variable not set for the following line of code in bold:Public Sub drawPlayer() drawWorld() If ResourceLib.ImageExists("Player_" + wGrid(PlayerPos.X, PlayerPos.Y).TileName) =...
9 Jul 2014 by DamithSL
You need to debug and find which is null at run time. read Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^] if you need more information about debugging. after you found the object which is null and the inputs which is reason for the generate null value, you can easily find a...
23 Jan 2017 by sebalius
I have a small program and when it runs the MDB database populates the Names into the ListBox. I have wrecked my brain trying to select a name in the Listbox and the full information to then populate the text Boxes. Eventually I wish to use the text Boxes to add new records to the database. Any...