Click here to Skip to main content
15,868,164 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 Score

Visual Basic 11 

8 Nov 2016 by Niemand25
A simple way to place any ObjectListView inside a ComboBox
28 May 2014 by Thava Rajan
Copy and insert data at any postion in your datagridview
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 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...
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...
10 Jun 2014 by Thava Rajan
This tip is used to fix a workaround for a bug in double click on checkbox
2 Jul 2014 by Sergey Alexandrovich Kryukov
If this is C++ and not C++/CLI, there is no "conversion", it simply makes no sense: the languages target different no-isomorphic platforms. In practice, through out UI, use the original code only as a reference for creating a new one. Before even trying to do it, review your decision again: do...
12 Jul 2015 by DamithSL
changerow = New String() {myList1(index)}dgvData.Rows.Add(row)to dgvData.Rows.Add(myList1(index).Split(New Char() {","c}))
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...
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...
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...
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 =...
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...
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...
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)() ...
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) _ ...
16 Mar 2020 by OriginalGriff
An SqlConnection can only support one DataReader at a time: when you "share" a connection you have to make sure that the reader is closed and disposed when you are finished with it at all times. The best approach is not to "recycle" SQL...
20 Mar 2020 by OriginalGriff
An SqlConnection can only support one DataReader at a time: when you "share" a connection you have to make sure that the reader is closed and disposed when you are finished with it at all times. The best approach is not to "recycle" SQL...
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...
6 Jul 2021 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
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
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...
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.
30 Jun 2014 by Keith O. Williams
I have several sprite exposed errors. How do I correct the following errors:Sprite cannot expose Sprite outside the project through class Board ' Alternative method Public Sub AddPiece(ByVal Sprite As Sprite) ' Add this piece using the below methid ...
2 Jul 2014 by Member 10203966
Hi Team,What is ubr file format?How to open the file?Is there any editor to view the file?
2 Jul 2014 by Raje_
Refer this link :Details of the .ubr file extension[^]Good luck.
2 Jul 2014 by Legor
As found on file-extensions.orgThe UBR file extension is associated with the Internet Information Services a web server distributed as a part of Microsoft Windows NT-family of operating systems. The .ubr file contains configuration of IIS WCAT (Web Capacity Analysis Tool Settings).So in...
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...
16 Aug 2014 by witek2424
Hello I have a registration form mysql need to add code to detect if the user exists. The existence if it should show the window (alredy registered user)code:Imports MySql.Data.MySqlClientPublic Class Form2 'create a public function and set your MySQL Connection . Public...
17 Aug 2014 by Vinay Mistry
Try this to check duplicate username before inserting.sqlcommand = New SqlCommand("Select * from users where username=yourusername", cnn)Dim adp As SqlDataAdapter = New SqlDataAdapter(sqlcommand)Dim ds As DataSet = New DataSet()adp.Fill(ds)If ds.Tables(0).Rows.Count > 0 ThenReturn...
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
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 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 =...
1 Dec 2014 by DamithSL
try like below Dim SumOfTotalCosts As Double = lbTotalCost.Items.Cast(Of Double)().Sum()
4 Dec 2014 by Dave Kreskowiak
OS hooks are not going to do it.What you're describing is a proxy server. All requests go through the proxy and it can do whatever it wants with the URL requested, including count how many times it's visited.A proxy is just about the only thing that's going to work with all...
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....
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...
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 ?
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 ????
31 Mar 2015 by AnotherKen
Maybe this will help? Mouse and Keyboard Tracking and Simulator[^]
4 Apr 2015 by BacchusBeale
You could make/host an error HTML page and redirect (Navigate) to there when there's an error.
15 Apr 2015 by Chris Jorna
Communication Library Files - NetTools | IsSameSubnet
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...
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[^]
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...
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.
12 Jul 2015 by EMSIarma
Hello,I would like to ask for a help because I'm really stuck for a few days while searching for any possible hints for this.I'm using VB 2010 Express.I have a multiline text box (filled manually - not from the external file) with content like:A,123,abcB,456,defC,789,ghi... and I...
11 Nov 2015 by jharding08
Looking for an easy example of how to bind data from a multi-join table dataset (main table with 3-4 foreign keys to lookup data) to a datagrid as well as textboxes and comboboxes.I'd like to be able to select from all available values in the combobox and then add/edit to the main form from...
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...
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...
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.
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 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 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 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 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 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 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...
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...
23 Jan 2017 by Thregarth
Which you need is to read from Patients table by lstnames selected value and pass others fields value to textboxes 'Create Connection from connectionString Dim objConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Temp\Hospital.mdb;") 'Create a...
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 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...
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...
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 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 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.
3 Mar 2018 by Richard MacCutchan
Why have you posted this question? It is the same issue as you already posted at How to sort listbox rows using first item in VB?[^].
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...
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,...
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...
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...
16 Mar 2020 by Dave Kreskowiak
It appears that you made the mistake of using a single SqlConnection object throughout your entire class. That's the wrong way to do it and leads to problems like this. ALWAYS create your connection when you need it, like in this method you...
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...
19 Mar 2020 by Maciej Los
Check this: string xcontent = @" ant test1 test2 test3 ...
20 Mar 2020 by Xion1624
Private Sub tmchat_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmchat.Tick Using cmdreadchat As New MySqlCommand("SELECT chat FROM tb_chat", Conn) Dim chatreader As MySqlDataReader ...
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...
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 ilmualam
Thank you so much for this kind of question. This is what I want to know, THANK YOU.
6 Jul 2021 by Member 3892343
Youre right i used bindingsource instead Ty
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...
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) ...
17 Sep 2023 by OriginalGriff
This would be better posted in the dedicated forum: CodeProject.AI Discussions[^]
20 Sep 2012 by ledtech3
This is a project for creating code like the WMI code creator but the output is for VB.NET and Windows Forms instead of for a Console Application.