Click here to Skip to main content
15,892,059 members
Everything / Programming Languages / Visual Basic 12

Visual Basic 12

VB12

Great Reads

by Mr. xieguigang 谢桂纲
How to build my own 3D graphics engine from ZERO step by step
by Mr. xieguigang 谢桂纲
The ShellScript is originally developed for the debugging of my "genome-in-code" virtual cell simulation engine, but now it becomes a script language for a .Net program.
by William Costa Rodrigues
This article explains an easy method to download and update your WinForms application
by a_pess
Image File Format

Latest Articles

by William Costa Rodrigues
This article explains an easy method to download and update your WinForms application
by Mr. xieguigang 谢桂纲
How to build my own 3D graphics engine from ZERO step by step
by Mahesh Rajaram Shinde
This project is designed for addressing SQL Server Script deployment on multiple servers and databases.
by David Vanson
Generate you own barcodes for your business, Promotional items or to share links with friends.

All Articles

Sort by Title

Visual Basic 12 

4 Jul 2015 by Member 1583963
I am developing some software with VB 2012 on a Win 8.1 system. The resultant .exe file runs OK in the developing (/bin) folder but will not run when moved to another test folder (with its required dlls). Can anyone suggest a reason why this is happening?P.S. I initially suspected the...
4 Jul 2015 by OriginalGriff
We can't say, not from that limited a description, and no idea what your code is like - or even doing!But...if it's on the same machine start by looking at permissions: it's likely that the folder you have moved it to doesn't have the required write permissions. It's common for this kind of...
4 Jul 2015 by Afzaal Ahmad Zeeshan
Actually your executable is targeting some other resources found in the project folder (folder names also matter in this context; see Solution 1 by OriginalGriff for that because many things are required to run an application no matter if it just says Hello world in your Console). First of all,...
5 Jul 2015 by Member 1583963
Many thanks you have both pointed me in good directions.
25 Oct 2015 by Greg Nutt
This is a VB.NET Version for ".NET Remoting Events Explained"
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
30 Jan 2015 by Adrian Ulland
Hello, I just want to make sure you are aware this is a beginners project I am having. I am not using XNA.Framework, DirectX, Unity or any game engines, I am making my own game completely from scratch using windows forms in VB.net, so far its alright- however:Question 1: When you move around...
30 Jan 2015 by Sergey Alexandrovich Kryukov
Please see my comments to the question.Second thing you need is to stop using PictureBox. In your case, it is not helpful at all, only creates problems. I'll explain what to do instead. Please see my past answers:Append a picture within picturebox[^],draw a rectangle in C#[^],How do I...
7 Sep 2014 by RAHAOUI Mehdi
Hi everyone,I've an idea but i don't know how to proceed with it, i want to develop a software that can determine for me how much static shape (shape_one) i can put in a pre-defined shape (shape_two) by filling maximum of shape_two (optimizing)i've attached an illustration of the general...
7 Sep 2014 by CPallini
This Wikipedia page could be your starting point: "Bin packing problem"[^].
2 Apr 2019 by Member 13305368
Hello, Can someone help me adding two text box without clicking a button. example: textbox1 = (1) textbox2 =(50) textboxsum = (51)
2 Apr 2019 by Leo Chapiro
I would implement the TextChange-Event on the both of the textbox1 and textbox2 like this: Try textboxsum.Text = Convert.toInt32(textbox1.Text) + Convert.toInt32(textbox2.Text) Catch ...
15 Oct 2015 by naveen_g
Hi, Please help us.. We have converted our application from .Net 1.0 to .Net 2.0. After conversion we noticed TabStrip(IE Webcontrol) control is not working in IE. But it is working fine in chrome. Please suggest are we missing anything. Do we have latest DLL for IE WebControls.Same...
3 Jun 2014 by Keerthi Kumar(Andar)
Hi experts,i want to add ajax autocomplete extender in my project that has been created in vb.but service method is not calling. Its not working properly please help me solve this issue.my code is
3 Jun 2014 by DamithSL
change your web method signature as below System.Web.Services.WebMethod()> _Public Shared Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer) As List(Of String)End FunctionAnd you better follow the stems in AJAX...
10 Jun 2014 by Thava Rajan
This tip is used to fix a workaround for a bug in double click on checkbox
11 Aug 2014 by ShadowsrayChamhell
Hello,I have created a vb6 application and the exe runs properly if i have installed the vb6 on my computer. I created a set up file with inigo setup factory. When I installed the program in win 8 I am receiving "Application-defined or Object Defined error (runtime error 713)".Please...
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 Sep 2014 by Abinonos
Hello;I'm using NumericUpDown control on a windows form, when executing, pressing Delete key or Backspace key make the field empty.how can i reset the value to its minimum value when this situation occurs ?thank you
20 Sep 2014 by BillWoodruff
If your goal is to make sure the NumericUpDown Control is reset to its minimum value if the value-entry-field is empty, and the NumericUpDown Control loses Focus:private void numericUpDown1_Leave(object sender, EventArgs e){ if (numericUpDown1.Text == String.Empty) { ...
21 Sep 2014 by Abinonos
Thank you for your answers , Bill, Sergey;I'm trying your advices and solutions and will comment that soon.As i will use the NumericUpDown control many times, i will even consider iheriting from the raw one to implement any eventual solution.Thank you
20 Sep 2014 by Sergey Alexandrovich Kryukov
The control actually already behaves pretty reasonably. You are missing one important detail: when you type anything on the control, its property Value is not actually modified. Non-digits are filtered out, but you can use Del or Backspace and actually make the text input empty. Another detail...
11 May 2015 by Rabeea Qabaha
hello ...I'm developing program and I'm using Skybound Gecko browser ! i want to inter the username and password automatically when i open the page!I'm using this code to do this :Private Sub login_Click(sender As Object, e As EventArgs) Handles login.Click ...
10 Jan 2016 by David Vanson
Generate you own barcodes for your business, Promotional items or to share links with friends.
24 Jun 2015 by K.Sutin
Get closing quotes for multiple securities with asynchronous call to Bloomberg API using VB.
1 Feb 2017 by Mr. xieguigang 谢桂纲
How to build my own 3D graphics engine from ZERO step by step
30 Jan 2015 by Emiliarge
Using FindWindow() and WindowFromPoint() to identify window, and SetWindowText(), MoveWindow(), SetForegroundWindow(), EnableWindow() to interact with it
8 Dec 2014 by Nasi N
Hi, according to http://msdn.microsoft.com/en-us/library/windows/apps/hh202959(v=vs.105).aspx[^]i create a backgroundtransfer. i want when download is completed, that file moves to "Downloads Folder on root directory" (Phone or SD Card/Downloads). i don't know how can i make it, microsoft...
8 Dec 2014 by Richard MacCutchan
See http://msdn.microsoft.com/en-us/library/system.io.isolatedstorage.isolatedstoragefile%28v=vs.110%29.aspx[^].
14 Jun 2015 by Sergey Alexandrovich Kryukov
Sorry, this is not a question. Please see: vb.net AT commands to send SMS[^].—SA
27 Jan 2022 by cgthanes
Hi Friends,I m recently doing a program were import the data from Excel to .mdb access file using vb.net. But i have some problem, the data were inside the excel file is cannot import into the access file. can anyone help me? Please your help is required....Thanks.Best Regards,...
25 Aug 2015 by DamithSL
you need to read from excel and insert into access database using insert sql statement, currently you are creating access file and table but not inserting data. reading from excel file using select sql statement will not insert data to access database. sample code :Dim connect As String =...
27 Jan 2022 by Member 15515171
This code is working for me also thanku sir But What if my sheet name changes many time or I don't know sheet name
30 May 2016 by Member 12530466
Have made an application (VB/NET)that capture pics on packed articles.The problem is to get the resolution higher than 640 x 360 pixels.Many have this issue on the web but I can't find a not to complex solution.The year i 2016 and I thought these things should be fairly easy, but...
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...
24 May 2014 by Kailashkumar Raghvani
i have an panel control and change back background image Using Scroll in and Scroll out using do while loop
17 Jan 2022 by alip1
I have a report drawn through SSRB 3.0. The report is of the .rdl type so through VB.NET code and Report Viewer is hooked and displayed. The data set is managed dynamically so that records can be filtered according to the user's needs. The...
17 Jan 2022 by Richard Deeming
If you want to set the header via code, the simplest option is to add another parameter, pass the required title in that parameter, and set the text box's text to that parameter. Otherwise, you could use an expression for the text box parameter,...
13 May 2015 by Rabeea Qabaha
how i can know if the phone number exist in ms database or not ?I'm using this code but i have error , i think i need to get all phone number as array and search in array if the number exist or not .Dim number As String con.Open() Dim sql As String = "select cphone from cust...
14 May 2015 by virusstorm
What is your error? I can tell you now that unless the phone number you are looking for is the last entry in the table, you will never find it. You should be doing something like this:Dim number As StringDim found As Booleancon.Open()Dim sql As String = "select cphone from cust...
14 May 2015 by Richard Deeming
Let the database do the work for you:Using con As New OleDbConnection("YOUR CONNECTION STRING HERE") Using cmd As New OleDbCommand("SELECT TOP 1 cphone FROM cust WHERE cphone = ?", con) ' OleDb doesn't use named parameters, so only the order matters here: ...
15 May 2014 by a_pess
Image File Format
3 Jun 2019 by Member 10751808
Hi, I'm pretty new at this, so here goes... I'm trying to build a small vb program that will seek the information from the CISCO switch. Exemple: Switch name, Model, IP, Port VLAN Number and VOIP info. Just about the same as my FLUKE Link Runner AT1000. I would then use the prog at every...
3 Jun 2019 by Richard MacCutchan
This is not a coding issue. You need to study the documentation for the switch that explains the web interface (if any) that will give you this information.
5 Jan 2022 by Member 3892343
I have a database that will be full of data, I want in vb net ro clone this database, rename the cloned database and delete the all data of the original database. I want to use smo to copy/clone the database not backup the database, also any...
6 Jan 2022 by Member 3892343
Thank toy all I will try import/export first and then backup. Kyriakos
16 Apr 2015 by Chris Jorna
Communication Library Files - LMS5lib | Connection and structure
11 Jan 2017 by Member 11475482
Here is the code Imports System Imports System.IO.PortsPublic Class Form1Dim comPORT As StringDim receivedData As String = ""Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Enabled = False comPORT =...
11 Jan 2017 by Dave Kreskowiak
The problem is that you're app doesn't store the information in a data model. You're using a display/edit control as your data container and that's not good practice. It's also what's making it very difficult for you to do this comparison.Create a data model in your code to store the data....
19 Apr 2018 by Member 13771028
Private Sub OKbt1_Click(sender As Object, e As EventArgs) Handles OKbt1.Click Call Connect() ' [ connection to module ]' Dim Reader As SqlDataReader Try 'selecting DATA from DATABASE Dim query As String query = "select * from uinfo...
19 Apr 2018 by OriginalGriff
So many bad ideas in such a short piece of code... Don't do it like that! Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead. When you concatenate...
23 Jan 2015 by Member 10059109
I have a table in mydatabsae with 10 columns i am trying to populate an arraylist with those and then the first column with the name Submit_id to convert it in my array list from column to row how can i do that?Thanks.Imports SystemImports System.DataImports...
23 Jan 2015 by DamithSL
chnage list.Add(dtrow)to list.Add(dtrow.Item("Submit_id"))
4 Apr 2022 by razrx
What I want to achieved. IN MY DGV COL1 COL2 COL3 ITEM1 1 1 ITEM2 2 1 ITEM3 3 2 ITEM4 4 2 ITEM5 5 3 ITEM6 6 3 ITEM7 7 4 ITEM8 8 4 ITEM9 9 5 ITEM10 10 5 ITEM11 11 6 ITEM12 12 ...
4 Apr 2022 by Richard MacCutchan
For row As Integer = 1 To 14 DGV.Rows(row).Cells(2).Value = row Next
4 Apr 2022 by OriginalGriff
A better way would be to use a loop: For i As Integer = 0 To 14 DGV.Rows(i).Cells(2).Value = i + 1 Next But ... since indexes are zero based, the column you want to index is probably 1, not 2
20 Oct 2015 by Sreekanth Mothukuru
In this article, we are going to create an ASP.NET Web Forms application using Bootstrap, Bundle Resources and Web API
1 Jul 2014 by Member 10203966
Hi Team,We have vb6 billing application. It generates file with ubr format.I want to create the report reading that file. Using vb6 or vb.net.I want to convert the ubr file into readable format(txt,excel) and generate the reports
1 Jul 2014 by KarstenK
You should carefully read the code which is writing the file. Than you can decide whether you:1. write in that point the data in a txt file, or you 2. read your ubr file to write it out as text.I would prefer way 1, because ubr isnt a standard format.You better use VB.net because...
22 Apr 2022 by NyikoB
I developed an application for registration kids at Creche. There's one text box where I need a child's identification number. In this number it starts with a year e.g. 22 for 2022, and I need this number to increase automatically and in sequence...
22 Apr 2022 by gggustafson
Using a MariaDB with table named Last_ID, I use the following whenever I require a new unique id. BEGIN SET @last = 0; SELECT `last_member_id` FROM `Last_ID` WHERE id = 1 INTO @last FOR UPDATE; SET @last = @last + 1; UPDATE `Last_ID` SET...
14 Mar 2016 by Member 10655207
Dim ds As New DataSetds.Clear()Dim da As New OleDbDataAdapter("select * from Userinfo where Userinfo.NativePlace='" & ComboBox3.Text & "' and Userinfo.elite 'دائمي' and Userinfo.Userid not in (select Checkinout.Userid from Checkinout where Checkinout.CheckTime between #" &...
11 Aug 2014 by phanithly
I developing a system with Visual Basic 2013 and Crystal Report 13 After i convert it to setup file , It not support Font unicode on Crystal report viewer .It Okay on my computer but when install it on another computer i faced that problem .Thank you for reading ,i will be wait for...
25 Jul 2015 by bellatriks
Hi,I want to add three header row to DatagridView.Row1 -> Columns Header -> 2013,2014,2015 Years (Merge Months Count = 12)Row2 -> Columns Header -> 1,2,3,...,12 Months (Merge Days of Month = 28,30, or 31)Row3 -> Columns Header -> 1,2,3,...,28,29,30,31 Days of Month (I calculate this...
25 Jul 2015 by Ralf Meier
The DatagridView has only 1 HeaderRow.But what you can do to solve the issue :- you only display one month at time in the DGV- you set a Label over the DGV which shows the user the selected Month and Year. Or perhaps you do it with 2 Labels - one for the Year and one for the Month.The...
6 Nov 2018 by MS1995
Let's say I have record at table column is "Name" This record is 'Ali is a Man' What I'm trying Dv.rowfilter= "Name like 'a%m%'" I do it like SQL like clause but it fires exception EvaluateException With message Error in like operator: the string pattern 'a%m%' is invalid Any help ,please What...
6 Nov 2018 by Alek Massey
Wildcard chars are allowed at begining or end or both but not the middle. The following would be allowed and would include your target row. Dv.rowfilter="Name like '%a m%'" Operator LIKE is used to include only values that match a pattern with wildcards. Wildcard character is * or %, it can be...
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...
2 Jun 2014 by a_pess
Check image is upside down in VisualBasic.NET
19 May 2017 by zamzam_301
Peace upon you i'm trying to display Arabic numbers in crystal report viewer but i'm always getting them into English my environment is Windows 10 x64 visual studio 2013 crystal reports version for visual studio (10) Shokran What I have tried: stringVar StrArb :=...
19 May 2017 by Maciej Los
Not sure, i understand you well.... I'd suggest to read this: Number To Word (Arabic Version)[^] and this: How to convert number to words in Crystal Reports [^]
23 Feb 2015 by Sujith Karivelil
This article Describes Connectivity to Gmail using IMAP, and also guide you to download and save mail content along with attachment.
17 Jun 2014 by Member 10738621
Hi...i tried to send email notification using the notify button. The notify button is datagridviewtextboxcolumn13.Below is the coding.The problem is in the message.To.Add....Please advise? Thanks. Private Sub DataGridView1_CellContentClick(sender As Object, e As DataGridViewCellEventArgs)...
17 Jun 2014 by Raghubir_Sarkar
if Column DataGridViewTextBoxColumn13 has email address and you want to send mail on click event of cell contents of that particular column [All cells of column DataGridViewTextBoxColumn13]. Rewrite the code as -Private Sub DataGridView1_CellContentClick(sender As Object, e As...
7 Oct 2019 by BassamKassem
My problem is that when uploading bulk records to SQL Server database through VB.Net it creates a lot of EMPTY records after Inserting all records inside the xls file how to eliminate this issue. taking into consideration that Excel.xls file has no Empty records . What I have tried: ...
7 Oct 2019 by OriginalGriff
Quote: taking into consideration that Excel.xls file has no Empty records Are you sure? Most Excel files have more empty records than non-empty: all that lovely whitespace at teh bottom! Since you don't specify any limits on what rows are returned: MyCommand = New...
20 May 2015 by Member 11706292
Private Sub Middlewallmove_Tick(sender As Object, e As EventArgs) Handles MiddleWall.Tick ' Move the middle wall ball. Label4.Location = New Point(Label4.Location.X, Label4.Location.Y + yVel) ' Check for top wall. If Label4.Location.Y
20 May 2015 by OriginalGriff
Check that MiddleWall and BottomWallMove are both Timer class instances - if they aren't, they won't have a Tick event and you will get the error.I'd suspect that it should be ... Handles MiddleWallMove.Tick, or ... Handles BottomWall.Tick if you have been consistent in your naming.
22 Nov 2023 by Member 16146638
I am using SQL Server in a Vb.net program and when I try to specify an index with an ExecuteReader command that should be used, I get an error message about forceplan. I would like to use the index since it gives the best access. How do i force...
22 Nov 2023 by Richard MacCutchan
SET FORCEPLAN (Transact-SQL) - SQL Server | Microsoft Learn[^]
18 May 2014 by a_pess
Demonstrates how to retrieve resources from a .NET Assembly in Visual Basic .NET
4 Jan 2018 by Member 13607118
Dim da As New SqlDataAdapter da.InsertCommand = cmd da.InsertCommand.ExecuteNonQuery() 'Here i m geeting error What I have tried: i want solution of this i m inserting data in database and getting error
4 Jan 2018 by OriginalGriff
Look at the error message: Failed to convert parameter value from a string to a int32 It's saying "I expected an integer here, and you gave me a string that doesn't contain an integer value." So look at cmd using the debugger and see exactly what you are passing as the command - and since...
11 Sep 2014 by Lokeshlnt
Hi friends,I am placing a File Upload Control Inside Ajax TabContainer,When i upload a file the Fileupload1.filename will be Empty.Please help...
7 May 2015 by KukuhSP
I have a clone tabpage which has a datagridview.I tired to fill datagridview in each tabpage , because it's only fill on tabpage1This is my code for cloning tab :Dim Frm As New NewTabPage Dim MoreTabs As TabPage = Frm.TabPage1 Dim i As Integer ' = 1 For i = 1 To...
18 Sep 2021 by AdvenSQL
Plz Help I am using visual studio 2017, sql server 2016 I need to fill listview2(Containing Sub Departments) with checkboxes, based on another listview1 checked items & when I select an item in listview1 its all sub departments from Sql server...
18 Sep 2021 by Richard MacCutchan
Check the documentation: ListView.ItemCheck Event (System.Windows.Forms) | Microsoft Docs[^]
17 May 2017 by khalid4775
I want to fill combobox in datagrid with name of items not the id i have this code : its working fine but it dosent load in combobox its create new 3 columns What I have tried: Public Sub getItemUnits(DGV As DataGridView, ItemID As Integer) Dim adp As New...
15 May 2017 by Patrice T
Never build an SQL query by concatenating with user inputs, it is named "SQL injection", it is dangerous for your database and error prone. A single quote in a name and your program crash. If a user input like "Brian O'Conner" can crash your app, it is an SQL injection vulnerability. SQL...
17 May 2017 by khalid4775
i have fixed like so : Public Function Get_Units_By_ItemID(DGV As DataGridView, ByVal ItemID As Integer) As DataTable Dim dt As New DataTable p.Get_Units_By_ItemID(dt, ItemID) If dt.Rows.Count > 0 Then Dim dgvcc As...
20 Jan 2015 by Razors68
I am trying to populate some combo boxes at run time. I have this code in a separate module, there are other forms that call this sub and all work fine.When I run the code the msg box for the count of combo boxes returns 6 but the loop only runs once??Any help gratefully...
20 Jan 2015 by Sergey Alexandrovich Kryukov
In addition to "Next i" (why?!): you may not have any controls of this type of the form. Such controls are rarely put on a form directly, more typically, they are put as children of some nested panels and other container controls (tab pages, for example). You need to abstract out the loop in a...
4 Jul 2014 by Heba Kamel
i have directory named leftpanel in my vb projecti want to open leftpanel directory and read names of folders in it and read images in each folderi use Dim Dirs() As String = Directory.GetDirectories(StartPath) DirectoryList.AddRange(Dirs) For Each Dir As String In...
4 Jul 2014 by OriginalGriff
Try:Dim files() As String = Directory.GetFiles(dir)Or use the overload that lets you specify a "search pattern" to limit it to (say) .JPG files.
24 Aug 2018 by Sérgio Wilker
I'm trying to get the size of a file that is hosted on a server and put it in a "label" while the "BackgroundWorker" works in the background. I'm using "Try" to get the value, however the value is caught on the first attempt, after downloading if I press to try to get it again then it works. ...