Click here to Skip to main content
15,881,600 members
Everything / Programming Languages / Visual Basic 10

Visual Basic 10

VB10

Great Reads

by CS Rocks
This is a slideshow that works in a Silverlight 3 UserControl.
by Abhishek Sur
Gives an introduction of how to create SQL CLR managed objects in SQL server.
by kirkaiya
A very simple, XAML-based month-view calendar that shows appointments, exposes events, and allows dragging appointments in the current month.
by Mr. xieguigang 谢桂纲
Mathematical method of S-system equation to simulate a biochemical network system

Latest Articles

by Robert Gustafson
I've created an enhanced version of the Extended RichTextBox created by Razi Syed.
by Doug- VisualBasic VB.NET
A quick Function to get UTC / NTP time
by Richard Atkins
Create a fluid, multi-column, vertically ordered list using nested, floating divs
by Alexandros Pappas
Example of a self hosted WCF service over HTTPS with transaction

All Articles

Sort by Score

Visual Basic 10 

6 Oct 2009 by CS Rocks
This is a slideshow that works in a Silverlight 3 UserControl.
2 Aug 2009 by Abhishek Sur
Gives an introduction of how to create SQL CLR managed objects in SQL server.
21 Aug 2009 by kirkaiya
A very simple, XAML-based month-view calendar that shows appointments, exposes events, and allows dragging appointments in the current month.
6 Oct 2013 by Mr. xieguigang 谢桂纲
Mathematical method of S-system equation to simulate a biochemical network system
22 Mar 2013 by Terence Wallace
TexasQuest is a 2D side scroller platform game similiar to Super Mario
23 May 2012 by VJ Reddy
For the properties of the object set at design to be persisted in the form the DesignerSerializationVisibilityAttribute with the argument DesignerSerializationVisibility.Content is to be used like _Public ReadOnly...
3 Oct 2015 by Mr.PoorEnglish
what is "typed" on typed Dataset, and how to use it
26 Aug 2009 by Martin Hinshelwood
WPF drag and drop behaviour
22 Feb 2011 by Nish Nishant
Here's a quickly put together example:static void Main(){ Console.WriteLine(GetString(20));}static Random rand = new Random();private static char GetRandomChar(){ return (char)rand.Next('a', 'z');}private static string GetString(int length){ StringBuilder...
19 May 2012 by Sergey Alexandrovich Kryukov
I see no problem here at all. The interfaces may inherit one from another or not. A class or a structure can implement either of the two or both of them. How exactly you build this hierarchy depends on the application of all those types and does not depend on signatures of the methods you show...
23 Nov 2012 by André Kraak
I found this on MSDN:Quote: Scope in Visual Basic[^]Even if the scope of a variable is limited to a block, its lifetime is still that of the entire procedure. If you enter the block more than once during the procedure, each block variable retains its previous value. To avoid unexpected results...
2 Mar 2017 by David Vanson
A weather application for the current conditions in your area
10 May 2012 by Dave Kreskowiak
It doesn't work because you declared a variable that will point to an array of strings. You didn't actually CREATE an array of strings.You need to ReDim Preserve the array to a known size in order for this to work.Better yet, drop the array and use a List(Of String) instead. Then you...
28 Aug 2009 by EliottA
I'm making use of an extensive library of custom controls to create a dynamically constructed menu based off a data table I've received. All is well and fine, and I've added my controls to a FlowLayoutPanel (which had issues reordering controls embedded within due to the fact it's visibility was
16 Aug 2011 by Alan N
The class style can be modified after window creation via the Windows API functions Get/SetClassLong (or Get/SetClassLongPtr for 64 bit compatibility).Private Const GCL_STYLE As Integer = -26Private Const CS_NOCLOSE As Integer = &H200
15 Jan 2012 by Sergey Alexandrovich Kryukov
Let's do it quickly: read it withSystem.IO.StreamReader reader = new System.IO.StreamReader(fileName, System.Text.ASCIIEncoding.ASCII, false); write with System.IO.StreamWriter writer = new System.IO.StreamWriter(fileName, false, System.Text.UTF8Encoding.UTF8);—SA
9 Feb 2012 by Christian Graus
Why couldn't you type in the keywords I gave you the other day in to google ? I did it for you http://www.vb-helper.com/howto_net_get_cpu_serial_number_id.html[^]Don't work too hard, most people who get super stressed about securing their software, are vastly overestimating the...
3 May 2012 by VJ Reddy
The following code can be used to retrieve sub DataTables 'Sample data to run the codeDim parts As New DataTable()parts.Columns.Add("PartNum", GetType(Integer), Nothing)parts.Columns.Add("PartName", GetType(String), Nothing)parts.Rows.Add(1, "OneTwo")parts.Rows.Add(3,...
10 May 2012 by Maciej Los
Array Class[^]Arrays in VB.NET[^]
13 Sep 2012 by CorvetteGuru
Backup Stored Procedures in SQL Server.
22 Aug 2013 by Maciej Los
OK, before i answer the question, few notes: 1) bad practice - if some part of code is used more than once, you need to move it into separate procedure or function If (e.ColumnIndex = 5) Then ' Checking numeric value for Column 5 only 'see code below ElseIf...
11 Oct 2013 by heemanshubhalla
How to use Masked Textbox control in .NET
18 Dec 2013 by Maciej Los
It's quite simple.Catch TextBox.Text value to string variable, then remove "%" and divide by 100 ;)Please see:Replace[^]Decimal.TryParse[^]
8 Jun 2014 by Peter Leow
Typo: id=" & strid & ";"However, you should use Parameter-Queries-in-ASP.NET-with-MS-Access[^] to prevent sql injection.
10 Jun 2014 by phil.o
DateTime Structure[^]What is wrong with using the default constructor of the object used to manipulate dates and times in .NET ?But, most of all, what have you tried?
5 Apr 2016 by Jochen Arndt
Your loop iterates up to (and including) DataGridView3.Rows.Count. Change it to one less:For i As Integer = 0 To DataGridView3.Rows.Count - 1
27 May 2019 by Alexandros Pappas
Example of a self hosted WCF service over HTTPS with transaction
22 Jun 2021 by Maciej Los
If i understand you well, you want to get only those files where extension is *.txt. Then use Directory.GetFiles Method (System.IO) | Microsoft Docs[^] with searchPattern parameter. Dim myfiles As String = String.Join(Environment.NewLine, _ ...
11 Jan 2010 by Rick Shaub
You're using the wrong overload of Registry.OpenSubkey[^]. Registry.OpenSubkey(String) opens as read-only. Use RegistryKey.OpenSubKey(String, Boolean) instead. ie:Public Sub SavePreference(ByVal pref As String, ByVal value As String) Dim tmp As RegistryKey =...
12 Jul 2010 by Bangon Kali
This component will be used as a text box for automatically formatted currency values.
18 Aug 2010 by Fredrik Bornander
Something like this might solve it for you:Imports System.IOModule Module1 Sub Recurse(ByVal directory As DirectoryInfo, ByVal resultList As List(Of FileInfo)) resultList.AddRange(directory.GetFiles()) For Each subDirectory As DirectoryInfo In...
25 Aug 2010 by LittleYellowBird
Hi,This sounds like a great project. To get started, look for an example that is similar to what you want to achieve and have a go. There are lots of articles on this site that can help you.If or when you get stuck, post a small snippet of your problem code and a description of the...
22 Feb 2011 by Henry Minute
There are several ways to do what you want, which would be easier/quicker will depend on how long the largest string you need to process is.You could declare a string variable and instantiate it with garbage characters. Dim garbage As String =...
16 Mar 2011 by #realJSOP
Yes, you can write a plugin framework in andy .Net language. Try googling ".net plugin framework" and look through the 285,000 results that search will return. There are even some CodeProject articles on the first page of results.
13 May 2011 by Kschuler
This bit of code that you have:TextBox9.Text > TextBox8.Text is comparing string values. It doesn't know that you are comparing numbers, so it takes "1000" and it knows that "1" comes before "9" so it thinks that "1000" is less than "999". What you want to do is first convert the text into...
13 May 2011 by OriginalGriff
If you want a string comparison, compare strings. If you want any other form of comarison, compare other objects.In your case, you want to compare numbers, specifically integers, so compare numbers not strings."1000" is less than "999" because '1' is before '9' in the character...
2 Jul 2011 by Sergey Alexandrovich Kryukov
This is one of the worst designs somehow popular in newbies. The problem is: you cannot close main form without closing of the application. Look at you entry point (usually Program.Main). Look at the line with Application.Run; the argument of this method define which form is the main one. You...
7 Aug 2011 by Sergey Alexandrovich Kryukov
Look for isolated storage: http://msdn.microsoft.com/en-us/library/3ak841sy%28v=VS.100%29.aspx[^]. In particular, read the section "Secure Access" to understand security implications.If you want to encrypt the data, you should understand that the level of security depends on the strength of...
12 Aug 2011 by Simon Bang Terkildsen
use the FileName property
13 Aug 2011 by Wendelius
Try using the Control.HelpRequested[^] event for each control.
14 Aug 2011 by Wendelius
I added another answer since I felt this is a different question.Anyway, perhaps the easiest way is to use tooltip. For example try the following in your HelpRequested event:Dim toolTip1 As New ToolTip()toolTip1.Show("Some text goes here", Me.Button1, 1000)More info on...
9 Sep 2011 by a_pess
Turn an image to a ColorPicker.
1 Nov 2011 by Abhinav S
You can always do a search on the internet. Here are some links that I came across - http://www.vbtutor.net/vb2008/vb2008_lesson18.html[^]http://www.homeandlearn.co.uk/net/nets4p15.html[^]Another useful site for this type of question is msdn[^].
26 Nov 2011 by LanFanNinja
If you want to select only a specific item at start up use this codeComboBox1.SelectedIndex = 0 'would set it to 246mb, 1 would set to 512mb, etc.To make you app remember which item was select when it closed and reselect it on start up you will need to first create a property in your...
28 Nov 2011 by Member 7656529
A review of the book Microsoft Visual Studio LightSwitch Business Application Development.
1 Dec 2011 by Sergey Alexandrovich Kryukov
First of all, do you know that one can install .NET Framework v.4.0 on any system where v.3.5 can be installed; and I don't see any reason for not doing it. (This is v.4.5 which cannot be installed on XP.)However, you can re-target your projects to any version starting from v.2.0 (the .NET...
8 Feb 2012 by Espen Harlinn
Have a look at: Application Trial Maker[^]Be aware that any moderately accomplished developer can easily break the protection offered by most .Net based protection mechanisms - so basically you should try to find a better way to motivate customer loyalty like subscription based extra online...
10 Feb 2012 by BobJanova
Find a service which provides this information (if you want the latest information you might have to pay, there is usually free service available for slightly delayed data), and then write against its API. That will probably contain a service method to get the data for a particular...
11 May 2012 by Maciej Los
Just replaceparts.Columns.Add("PartNum", GetType(Integer), Nothing)with:parts.Columns.Add("PartNum", GetType(String), Nothing)and the part numbers still will contain 0 (zero)
17 May 2012 by Sander Rossel
Hi all,I'm having a little problem designing an Interface I have (not the GUI).What I basically have is two Interfaces that do the same, but one of them needs to get an extra parameter to a Function.Public Interface IDoSomething(Of T) Function DoSomething(ByVal something As T) As...
21 May 2012 by Manfred Rudolf Bihy
What did you think the first sentence means in MSDNs documentation of String.TrimStart[^]."Removes all leading occurrences of a set of characters specified in an array from the current String object."This happens case insenstive so the a is also removed.BTW this is a very poor way to...
27 May 2012 by Mehdi Gholam
Usually attributes are processed once (type interrogation etc.) so performance is not critical so boxing is a viable option which reduces your code size.I am afraid you can not escape a big switch statement [or a nested IF] (if you can let me know! I have tried :) [DataTypes.cs in RaptorDB...
28 May 2012 by Andreas Gieriet
How about dynamic?If you are willing to pay the run-time cost, and if you are willing to give up on compile-time type check, dynamic could help.C# really lacks generics specialization and (especially if run-time performance matters) compile-time elaboration of generics.In C++ you can...
7 Jun 2012 by Dave Kreskowiak
How many labels are we talking about here? Since controls have an overhead, you might have to paint these items yourself for better performance.Though, twice a second isn't really a performance killer unless you've got a machine that was made 10 years ago.As for the user interaction...
23 Dec 2012 by Mehdi Gholam
Posted from the comment:Check if the "optimize code" is set in your project.
13 Jan 2013 by Sergey Alexandrovich Kryukov
First wrong point in the I can see in your code is this:if (t.GetInterfaces().Contains(typeof(IHeaderBarComponent))) ...Is your purpose selecting the type which implements IHeaderBarComponent?This is how it's done:System.Type headerBarComponentType =...
14 Feb 2013 by Asim Mahmood
try thishttp://stackoverflow.com/questions/9905900/finding-out-input-devices-connected-to-the-system-through-an-asp-net-webpage[^][]
17 Apr 2013 by Johnny J.
Adaption of pdoxtrader's codePublic Function BusIdExists(ByVal busid As String) As Boolean Dim thisSql As String = "SELECT Count(*) FROM [yourtable] WHERE busid=@busid" Dim rowCount As Integer ' Get the list of rows with that busid Using conn As New...
29 Apr 2013 by Aydin Homay
HiFor connecting to the any database(DBMS) in .NET you can use ADO.NET so for this purpose first of all you need a connection string after that for using a connection string you need a connection object. For sql server you can use SqlCilent library and for other database same as MySql you...
13 Jul 2013 by Sergey Alexandrovich Kryukov
To do #1, you don't even need the installation, unless you have to register data types or use some data prescribed in system Registry (which I would recommend to avoid unless it is absolutely necessary; you can always use application-specific data in the user profile).To do #2, you need to...
22 Aug 2013 by fjdiewornncalwe
For I = 0 To rowsTotal - 1 ' By including the -1 here you are actually skipping the last row For j = 0 To colsTotal - 1 ' By including the -1 here you are actually skipping the last column .Cells(I + 5, j + 1).value = DataGridView1.Rows(I).Cells(j).Value Next j Next I
22 Aug 2013 by Mehdi Gholam
Generally no, however take a look at this : Converting WinForms => Web Forms using CodeDom[^]
8 Jun 2014 by Sergey Alexandrovich Kryukov
As Peter pointed out in Solution 1, this is wrong approach, because you leave your application wide open to the well know exploit called SQL injecton. This is how:http://xkcd.com/327[^].This is what you need to use: http://msdn.microsoft.com/en-us/library/ff648339.aspx[^].See also:...
8 Oct 2014 by Sergey Alexandrovich Kryukov
First of all, never use System.Windows.Forms.Timer for animation, use one of the other timers. Even better and simpler, don't use a timer, use a separate thread. If you need to know real time of the move, use System.Diagnostics.Stopwatch (you only need relative time). Make smaller steps.Now,...
24 Dec 2015 by Sergey Alexandrovich Kryukov
Let's assume you have a standard Web camera.It would be bad to answer again and again the question asked so many times. Please see: Search - CodeProject[^].—SA
7 Mar 2016 by Yavuz Sevgi
find "adodb" in references and see adodb.dll properties. "Embeded Interop Types" set to false than you can set "Copy Local" to true .
24 Mar 2016 by F-ES Sitecore
Please do basic research before asking a question such as using google. Use the ServiceController classServiceController Class (System.ServiceProcess)[^]ServiceController Constructor (String, String) (System.ServiceProcess)[^]Obviously the account your code is running under will...
30 Jun 2016 by Dave Kreskowiak
It would appear that your SQL Server is setup for Windows Authentication only and you're trying to pass sn SQL login in the connection string.You have to modify the SQL Server to allow Mixed authentication, Windows Auth and SQL auth.Also, using the SA account to do this stuff is a...
22 Jul 2016 by khaled Ezzat Abdelfattah Abdelgawad
your code should update recor if reader has values and else inserts new record, so your code inside your btnAdd should be exactly as follows: Dim sqlQRY As String = "SELECT * FROM Products WHERE ProductCode = '" & txtCode.Text & "'" Dim cmd As OleDbCommand = New OleDbCommand(sqlQRY,...
17 Jun 2017 by Richard MacCutchan
No it is not wrong. See What Every Computer Scientist Should Know About Floating-Point Arithmetic[^].
16 Feb 2020 by phil.o
You did not initialize the Firmata variable. It seems like your session variable is already of a type implementing IFirmataProtocol interface anyway. Try to use it instead, and only initialize it once the connection has been opened: Dim...
22 Jun 2021 by Richard MacCutchan
Try something like: Dim myfiles() As String = Directory.GetFiles("C:\TestFolder", "*.txt") _ .Select(Function(x) New FileInfo(x)) _ .OrderByDescending(Function(x) x.LastWriteTime) _ .Select(Function(x) x.FullName).ToArray For Each...
19 Oct 2021 by Maciej Los
I'd strongly suggest to read this: Use WinForms ReportViewer Control - SQL Server Reporting Services (SSRS) | Microsoft Docs[^] There you'll find complete tutorial about loading rdlc report. Note: do not forget to use links on the left pane of...
24 Sep 2022 by OriginalGriff
The problem is that - rightly - debug and release configurations (including the settings file) are completely independent. If they weren't, then there would be a high risk of dev builds accessing production databases for example - which could be...
21 Aug 2009 by Martin Hinshelwood
I am always pulling out the Unity assemblies. Maybe it is just because I am lazy, but I really can’t be bothered rolling my own dependency injection and mapping framework!
25 Nov 2009 by AspDotNetDev
Kinda hard to answer this without you posting some code. More than likely though, you've just botched something when transitioning between the standalone and XBAP. If you post an example, keep it short and sweet... we don't need 10 pages of code, but we do need to see a simple example of your malfun
15 Apr 2010 by Paulo Morgado
Getting Interface Property Implementations
7 Jul 2010 by alrosan
Module Module1 Dim cnt As Integer Sub Main() cnt = 0 Console.WriteLine(CountFiles()) Console.Read() End Sub Function CountFiles(Optional ByVal dri As String = "C:\", Optional ByVal subDir As Boolean = True) As Integer On Error Resume...
8 Jul 2010 by idenizeni
Ok, I found your solution, your drive string contains 'C:' you need to append the '\' to it. Dim drive As String = Path.GetPathRoot(System.Environment.ExpandEnvironmentVariables("%SystemDrive%")) & "\"Dim counter3 As System.Collections.ObjectModel.ReadOnlyCollection(Of String)counter3 =...
24 Aug 2010 by Christian Graus
So what you mean is that you want to read the byte data, and view it as a list of decimal numbers ? File.ReadAllBytes will give you a byte array, then you can use a string builder and foreach to iterate over that, and build your list of numbers. ASCII is the older way of encoding text, if you...
22 Oct 2010 by Kschuler
In Project Settings on the Publish Tab, did you put a value in for Installation Folder URL? If so, you need to make sure that you click the Updates button and put the same URL in the Update location box on the Application Updates screen. Also, make sure you have the The application should...
15 Dec 2010 by junrall
Hello All!So, just like a lot of others, I thought I'd try my hand at colorizing keywords. Not that I need it for anything serious... just figured it would be fun to try... and so far it has been fun!Anyways, what I have works pretty good. However, I'm wondering if there is any way to...
15 Dec 2010 by E.F. Nijboer
Well, because of the increasing amount of time needed I suspect the following.You are working on the actual RTF in the RTF component on your form. So each time you paste it into it, the RTF is becoming larger and harder to process. This is because each style you apply to the text will add...
23 Jan 2011 by Manfred Rudolf Bihy
The only difference I could spot is that in your button click handler you're not using the already initialized m_Grphics Graphics context but are creating a new one with m_Graphics = picCanvas.CreateGraphics. Since you didn't do that in your MouseMove event handler which you said yields the...
23 Jan 2011 by Christian Graus
You've not done what was advised. Don't keep a graphics object in memory. If you draw something within these panels, create a derived class that does your drawing in it's paint event. As for your main question, you're drawing within the panel, so I don't see how it could appear anywhere else,...
15 Feb 2011 by Sergey Alexandrovich Kryukov
The best advice I can give you: never use MDI!This recommendation was given many times on CodeProject.It looks like no one is happy with this design; it is extremely inconvenient. I don't know a single decent or just professionally written application which uses it.There are many much...
16 Feb 2011 by Espen Harlinn
As I’m not privy to your code – I can only speculate. How about a visible tabs collection or visible tab index property in your view model? A bit of modulus trickery could cause this to automagically wrap around to the first visible tab when passing the end of the collection - well it's just a...
17 Feb 2011 by zafi24
I manage to publish my my program to project. Its partially working. When I try to use Hot key function ALT Z, (To capture image) this error appears:Seriously I don't know what to do next. It seems working before I publish it without wany warning or errors. See the end of this message for...
21 Feb 2011 by zafi24
Hi all,I have browse information from many source in this forum and found out many information which is very useful. However I still having a problem.What I intend to do now, link the MS Acess my with program and publish it (Use it like installer in other computer).My problem:-1....
24 Feb 2011 by zafi24
Hi all,I install my program using ClickOnce deployment, the files will be installed in this path:- ( i get from the forum info)the sub folders of [System Drive]:\Documents and Settings\[User Name]\Local Settings\Apps\2.0Then, I try to locate mine. I have 3 folder in that path....
28 Feb 2011 by Dave Kreskowiak
You cannot change that path. ClickOnce will only install to that path, no other.
1 Mar 2011 by Gregory Gadow
Executable files can be placed anywhere, so searching in Program Files is probably not going to work all the time. And the registry is iffy: even if you know where major browsers currently store data, there is no guarantee that future versions will put data in the same location, or that browsers...
10 Mar 2011 by luisnike19
If you don't have sql server in your other machine, you could install the DB using a sql script and pointing to another machine (instance of sql server)script[^]Depends if you are going to use installshield, VisualStudio, or another how you will do it.
24 Mar 2011 by Dave Kreskowiak
If your trying to wire up the Click event for a button you just created in code, look into AddHandler[^]. If you're trying to remove the handler and replace it with something else, you'll also need RemoveHandler.
24 Mar 2011 by Dave Kreskowiak
You should have posted a new question for this. The method you wire the MouseUp event to must match exactly, the header for the event. Why are you wiring MouseUp instead of Click??
25 May 2011 by Simon_Whale
why not just create a custom handler for all the textboxes? addhandler textbox1.textchanged, addressof textchangedhandler addhandler textbox2.textchanged, addressof textchangedhandler .... 'add additional textbox handlers .... addhandler textbox7.textchanged, addressof...
26 May 2011 by Abhinav S
See http://msdn.microsoft.com/en-us/library/ms160064.aspx[^].As per this link "Minimum and maximum timeout values are enforced by the operating system and are typically 10 and 30 seconds, respectively, however this can vary depending on the operating system. Timeout values that are too large...
26 May 2011 by Kim Togo
No you cannot. The minimum and maximum timeout values are enforced by the operating system and is typically 10 and 30 seconds. But I think it can be changed via Registry settings. But then it will be global for all programs that uses BalloonTip.I think a better option is to make the...
6 Jun 2011 by DaveAuld
TrueChart is a charting component developed by GrapeCity.I suggest you start by searching their support/documentation for more answers.http://www.grapecity.com/[^]
2 Jul 2011 by harish85
I think first as start you can go through the bit torrent protocol and its normal mechanism,Here is the fav wiki page for it http://en.wikipedia.org/wiki/BitTorrent_(protocol)[^]Then, Here is open source hosted in google base for peer to peer communication- you can check this out...