Click here to Skip to main content
15,893,722 members
Everything / Programming Languages / Visual Basic

Visual Basic

VB

Great Reads

by Fredrik Bornander
WPF Implementation of the spinning panel frequently used on the iPhone
by Steve Krile
Fully AJAX-enabled user control used to select names from a database in a drop-down format.
by Graeme_Grant
A Modern Toggle Switch - From mock concept to a full custom WPF control that you can plug into your own apps
by JosipK, Marko Kozlina
C# and VB.NET console applications that demonstrate how to create and send an email reply with IMAP and SMTP protocols in .NET Framework

Latest Articles

by Jo_vb.net
This article and the demo are about getting started using my Schafkopf_OOP VB.NET project.
by CODING_MLD
Expanding and collapsible panels implemented in VB.NET
by Allegra Angelo
Save, read and text recognition of network parameters
by Ralf Meier
This article revolutionizes Shelly device management, providing an updated, efficient, and feature-rich solution for both beginners and advanced users." You will discover new ShellyCom2 features, such as property manipulation using PropertyDescriptor, and a set of valuable helpers and commands.

All Articles

Sort by Updated

Visual Basic 

7 Feb 2019 by ! E M O T I O N A L !
If any of you have used Bunifu UI without putting in a license key, you might get what I mean by this. Basically, if I do something specific, like change the icon on a form, I want a window to pop up telling the user something, like "You just changed the icon!". How would I go about doing...
16 Apr 2019 by ! E M O T I O N A L !
Hello, I'm trying to read a simple value from a regedit key in Visual Basic. I want the program to read the key, then set a registry value as the value of that key. Here's the code: Shared Sub DWMDefault() Dim regKey As RegistryKey = _...
26 Apr 2019 by ! E M O T I O N A L !
Hello, and I'm making a program that changes the value of some registry keys and the value needs to be exclusively Decimal format. How would I go about doing this? Shared Sub SetColorizationColor(ByVal color As String) Dim regKey As RegistryKey regKey =...
5 Jun 2015 by #dev_Preet
I am trying to connect mysql database that is on Ubuntu through a vb.net code:Imports MySql.Data.MySqlClientPublic Class Form1 Dim conn As New MySqlConnection Dim reader As MySqlDataReader Public Sub connect() Dim DatabaseName As String = "CTCL_Strategy" ...
9 Jan 2010 by #realJSOP
What d@nish said... (Content must be at least 30 characters? That makes it impossible to type "google" and be done with it.)
11 Jan 2010 by #realJSOP
Well, looks like the currently logged in user doesn't have rights to modify the registry. What's the question?
11 Jan 2010 by #realJSOP
I dunno. I've never heard of "REALbasic".
13 Jan 2010 by #realJSOP
Along with Rick's response, you can also create custom events that you can use to notify subscribed objects of the progress of important events within the thread. I use a thread pool, and custom events and it works great. I also would like to reiterate Rick's recommendation of the use of Invoke...
21 Jan 2010 by #realJSOP
Just create one storyboard for each animation.
22 Jan 2010 by #realJSOP
First, you're going to have to load the data into a list. At that point, you can use Linq to perform sql-like queries on the list.
22 Jan 2010 by #realJSOP
Ummm, pulling data from the controls of another form is bad practice. You should instead use a globally accessible (static) object.
25 Jan 2010 by #realJSOP
Use a BackgroundWorker object instead of a normal thread. They are much easier to work with because you can just call BackgroundWorker.CancelAsync() and be done with it.
30 Jan 2010 by #realJSOP
In the spirit of "Quick Answers"...I would use Visual Studio 2008 on a Windows system.
1 Feb 2010 by #realJSOP
Maybe you need to specify xlSht.Cells(i+1).Value or something like that (and you may even need to cast it from an object to a specific type).
3 Feb 2010 by #realJSOP
Well, did you google the error message?http://msdn.microsoft.com/en-us/library/76435b93%28VS.80%29.aspx[^]
4 Feb 2010 by #realJSOP
Your question doesn't provide enough info to be answered. I suspect this has something to do with shortcuts, but I can't be sure of what you want.
5 Feb 2010 by #realJSOP
This is not an appropriate Quick Answer question. The chance that the person you're trying to contact will even see this is remote at best.
11 Feb 2010 by #realJSOP
You're trying to call Windows API methods that aren't directly accessible from .Net.You need to import the System.Runtime.InteropServices and learn about Invoke. Go to tis site for windows API prototypes for .Net:pinvoke.net[^]They have both VB and C# examples for most functions.
18 Feb 2010 by #realJSOP
There are several kinds of comboboxes. Which one are you talking about?I would start with ComboBox.SelectedItem = null or something like that. I Imagine you can do something similar with the DateTimePicker. Of course, you could probably find all your answers with a quick google search.
9 Jul 2011 by #realJSOP
Avoid exceptions when setting enumerators from unknown/untrusted sources.
20 Feb 2010 by #realJSOP
Yes, they automatically get added to the assembly binary if you set it up that way (which is the default).
21 Feb 2010 by #realJSOP
I don't have a tree control handy in an app, but see if there's a SelectedItem property, and if there is, set it to null.
28 Feb 2010 by #realJSOP
We can't give you an answer if you don't ask us a question.Have you tried myButton.PerformClick() instead of all that other stuff?
5 Mar 2010 by #realJSOP
Did you google that exception?I found this:1) Remove the references to the assemblies that are LoaderLocking. (I recommend writing down the path to the assembly so you don't forget it.)2) Rebuild. The build will fail.3) Add back the references to the assemblies you just removed.4)...
7 Mar 2010 by #realJSOP
WPF's ListView doesn't have "SubItems" like the Windows Forms ListView does.do this in yur C# code:listView.ItemsSource = myCollection;and something like this in your XAML ...
7 Mar 2010 by #realJSOP
If you can use google, you can find them. It's easy - really.
9 Mar 2010 by #realJSOP
Did you bother to google the error? I did, and I got over 1300 hits.
13 Mar 2010 by #realJSOP
This is where real skill involved in being a programmer is required. I would hope that your professor wouldn't have given you the assignment if he didn't think he had taught you everything you need to know in order to successfully complete the project.zong0525 wrote:if you guys could help me...
13 Mar 2010 by #realJSOP
Create your HTML (as a string) for the form/controls, and use the HtmlDocument class to add InnerText to the tag.
14 Mar 2010 by #realJSOP
ffmpeg is a free utility that can return media file info if you know the correct command line switches.Google is your friend.
15 Mar 2010 by #realJSOP
You need to get the handle to the other applications window, and send that window a WM_FOCUS message.If you launched the app yourself, you could get the window handle by way of manipulating the Process object you used to launch the application.
15 Mar 2010 by #realJSOP
So why can't you just convert it? The .Net library is always the same, regardless of the language you use. It truly isn't a difficult task to convert it. Besides, the XAML won't change - only the code behind it will.BTW, there are several free web-based converters available. Sadly, none...
16 Mar 2010 by #realJSOP
It seems to me that you would want to change the data itself (you still have it in memory), and then simply refresh/rebind the DataGridView.So, you'd need to iterate through the rows in the dataset, change the values, and Bob's your uncle.
16 Mar 2010 by #realJSOP
First, I would use a for loop instead of a while loop because the for loop will maintain your counter.Second, it looks like you want to set the Item's color - not the sub-items.Are you not getting any color at all, or is it that the wrong cell is changing color?
19 Mar 2010 by #realJSOP
I googled "jquery chat", and found this:http://articles.sitepoint.com/article/ajax-jquery/2[^]You can google too. It's easy. Really. I've seen other people use google too.
4 Apr 2010 by #realJSOP
Maybe you could export to html and then push the HTML to a PDF file instead of going the direct route.
3 Apr 2010 by #realJSOP
Google is your friend. There are 897,000 hits, and I'm sure one of them can give you what you want. Of note, an article right here on CodeProject is the very first link listed.
3 Apr 2010 by #realJSOP
select * from students where subjectnumber = 100 or subjectnumber = 220It ain't rocket science.
4 Apr 2010 by #realJSOP
You could try to open it as a normal file with exclusive read and see if you get an exception. If you get an exception, the file is currently open.
6 Apr 2010 by #realJSOP
You may be able to telnet into the router and retrieve the desired file, but I'd be willing to be it's encrypted (at least, it better be).
7 Apr 2010 by #realJSOP
Wow. Google has the answer. Imagine that. I found this on another web site:-----------------I think you want the Phone API:http://msdn.microsoft.com/en-us/library/bb416387.aspx[^]Specifically, there are calls to PhoneOpenCallLog, PhoneSeekCallLog, etc.
11 Apr 2010 by #realJSOP
It's my guess that you have something in the default constructor that the designer can't cope with.Create an overloaded constructor that your application calls, or put the offending code in the existing constructor into a block that that doesn't execute if the form is opened in the...
14 Apr 2010 by #realJSOP
Make sure that the service class inherits from System.Web.Services.Service.Without this you don't have access to the Server object.
17 Apr 2010 by #realJSOP
Handle the MouseEnter event for the tab.
19 Apr 2010 by #realJSOP
Handle the KeyUp event in the appropriate form, and in the handler, look for the key code for the escape key in e.KeyCode.
20 Apr 2010 by #realJSOP
Techically, you can't draw sphere. You can draw a circle and simulate a3-D look with clever use of shadows and gradients.
22 Apr 2010 by #realJSOP
With the pitiful amount of info you've provided, the best I can suggest is that you look into using a Dictionary object instead of an Array.
25 Apr 2010 by #realJSOP
You probably mean "macro". And no, there's no such thing as a "macro" in VB.Just write the codez, doode.
30 Apr 2010 by #realJSOP
You're not holding your head at the right angle.
30 Apr 2010 by #realJSOP
While Griff's solution is appropriate, I'm not a big fan of Regex, so I would approach it this way:myString = myString.Replace("%P", replacementString);That's a LOT less code, a LOT faster than Regex will ever be, and consumes fewer resources besides.
1 May 2010 by #realJSOP
Yeah, but you would have to use the WebClient object to do it. You need to request the upload page, parse the response so that the appropriate page control contains your filename, and then post it back. It's not trivial, but it's not hard either.
2 May 2010 by #realJSOP
Maybe you should hire someone else to do this for you - you seem to be a complete novice to programming in general and .Net programming in particular.On the off chance that you might decide to use google, I would search for the "pinvoke" and "com port library". Maybe you'll get lucky and...
3 May 2010 by #realJSOP
This is "Quick Answers", not "Teach me how to write a program". Work on it yourself, and come back here to ask questions about the parts you're having problems with.
8 May 2010 by #realJSOP
Well, where did you get the code? If you got it from an article here on CodeProject, then you have to post the question in the forum for that article.
8 May 2010 by #realJSOP
IMHO, the grid shouldn't be involved in validation of data. The data should be validated before it's bound to the grid. Are you getting the data from a database? Is the column a numeric value column (int, decimal, float)?
8 May 2010 by #realJSOP
Well, your question is so vague as to be considered unanswerable in its current form. What country are you looking for? Are you sure you're spelling it the same way as yahoo is?
9 May 2010 by #realJSOP
You could 0) script the creation of the database to a file1) attach that file to your application as a resource2) each time your program starts (after being installed), it can check to see if the database is installed 3) if not, extract the script from the resources and run it on...
9 May 2010 by #realJSOP
Did you run it under the debugger to try to find out what's wrong?
10 May 2010 by #realJSOP
All you've provided is some HTML. That's not an application. Beyond that, asking how to write an application in Quick Answers is beyond the charter of Quick Answers, and therefore, is inappropriate.
11 May 2010 by #realJSOP
Remoting is a slug. I have no performance metrics for a WCF comparison, but rolling your own code is always a better performance choice rather than using what Microsoft provides for the sake of convenience. Of course, rolling your own code takes a bit longer...
11 May 2010 by #realJSOP
You can't. The TextBox has a FontSize property, and that's what size the font is. If you want to change the size of selected text, I think you're going to have to fiddle around with a RichText control.
12 May 2010 by #realJSOP
Are all of the files shown in the listbox?Have you tried just copying all of the files regardless of whether or not they've been selected?Have you run it under the debugger? The code you've posted doesn't really show much.
16 May 2010 by #realJSOP
What part of that didn't you understand? It's telling you *exactly* what is required.0) The web server account needs read/write access to the Applications folder if the App_Data folder doesn't already exist. Solution - create the App_Data folder in your project BEFORE you deploy it.1)...
20 May 2010 by #realJSOP
If the lines are separated by \r\n, you can do a string.Split("\r\n") on it, and then you end up with an array of two (or more) strings.At that point, you can do if (strings[0].StartsWith("S:"), etc, etc.
23 May 2010 by #realJSOP
Well, you need to start your background worker, fire off a progress event at appropriate intervals. In the event handler, update the progress bar (you will need to use Invoke to update the UI).
2 Jun 2010 by #realJSOP
What you want to google is "C# interprocess communications". There are several ways to accomplish this (remoting, WCF, TCP/IP lister, and there's even a message called WM_BROADCAST (or something like that).Which method you choose is based on the program's intended use and the topology on...
3 Jun 2010 by #realJSOP
Yeah it's possible. Legal? Depends on where you're getting the search results.
6 Jun 2010 by #realJSOP
I don't see anything weird about your code. Have you run it under the debugger?
15 Jun 2010 by #realJSOP
Elephants, because bananas don't have bones.
20 Jun 2010 by #realJSOP
you could say item.FirstName.StartsWith("AL")
26 Jun 2010 by #realJSOP
There are three tangibles:0) A database1) A web service to access the database2) A web site to access the web serviceThere are several intangibles0) Security1) Platform (HTML/ PHP, ASP.Net, Silverlight)2) Programming languageIMHO, you\'d be better off going with...
26 Jun 2010 by #realJSOP
Google is easyhttp://msdn.microsoft.com/en-us/library/system.io.binaryreader%28v=VS.71%29.aspx[
28 Jun 2010 by #realJSOP
I wrote an article (for C++) that might be of help. It retrieved menu items from a database and built the entire menu structur for a desktop application from the retrieved menu items. It may help you come up with a design, so here it is:Dynamically Build Your Menu and/or Toolbar[^]The...
7 Jul 2010 by #realJSOP
I would start by looking at your sqlParam object (obviously a list or array of some sort). One of the parameters must be causing the problem.
8 Jul 2010 by #realJSOP
Well, what is the type of the overflowing value? a double? A Decimal? Something else? Was your code generated by an automated tool? We really can't help you much beyond suggesting things for you to try.The debugger is your friend.
8 Jul 2010 by #realJSOP
I think you need the Office SDK for .Net. I don't know anything about it, but with it, you may be able to close single documents (if that's what you meant). Google is your friend.
13 Jul 2010 by #realJSOP
Do you even know what "client-server" means?
14 Jul 2010 by #realJSOP
Use the Math.Abs() method.EDIT -----------Sorry, didn't know Christian had already suggested it. If the OP had marked it as answered, I wouldn't have bothered with a response.
15 Jul 2010 by #realJSOP
Why don't you google "point of sale system", and find out?
16 Jul 2010 by #realJSOP
I deleted your other "quick answer" question. First, never EVER post your email address. The web site will automatically notify you via your registration email address of any responses. Second, You should have edited THIS question instead of posting another one. Third, you're posting a question...
20 Jul 2010 by #realJSOP
It's call "maximizing". Just set the appropriate property for the form.me.WindowState = FormWindowState.Maximized
24 Jul 2010 by #realJSOP
You probably haven't set the MDIParent property on the form.
25 Jul 2010 by #realJSOP
Look at this tip/trick here on CodeProject:Scanning Folders on a Network Share[^]
25 Jul 2010 by #realJSOP
I played around with this and got "access denied" exceptions on some folders which aborted the GetDirectories() method and thus returned nothing. I had to scan one folder at a time, like so:////////////////////////////////////////////////////public class FolderInfo{ public string...
28 Jul 2010 by #realJSOP
I personally think that's bad practice. There should always be a default selection on radio buttons. It would be MORE correct to add a radio butotn that simply says "Not selected", and check it by default.
31 Jul 2010 by #realJSOP
Did you search google? There are HUNDREDS of examples of how to do this.
10 Aug 2010 by #realJSOP
You've already identified the solution - create a windows service. Go forth and code.
12 Aug 2010 by #realJSOP
Change the Margin property.
13 Aug 2010 by #realJSOP
In the message they wrote, there should be a Email link on the bottom left of the message window.
20 Aug 2010 by #realJSOP
Instead of raising another event, why don't you just put the functionality into a common method, and call that common method from both click event handlers.Sometimes, the simplest approach is - well - the simplest approach.
21 Aug 2010 by #realJSOP
You need to retrieve the contents of the form2 TextBox control before form2 is disposed. To do that, you have to handle the Closing event for form2 inside form1. In that event handler, you simply use your property to retrieve the contents of the Form2.TextBox, and do whatever you need to with it.
22 Aug 2010 by #realJSOP
Just convert the bytes to an ascii string, and put that string in a hidden div (with a known ID assigned to it).
24 Aug 2010 by #realJSOP
I think the only way to do this is to come up with a custom control derived from the ListBox control that uses a RichText edit box to display its items.On the other hand, you could just change the background color of an item than contains one or more of the specified values, and in a tooltip...
25 Aug 2010 by #realJSOP
To make the game more interesting, you should provide somethig to keep them from trying to count the seconds, and THEN ask them to guess how many seconds:- Solve an anagram- Perform a simple math calculation- Arrange playing cards in the correct order- Provide parts for a robot and...
25 Aug 2010 by #realJSOP
At the end of the event handler, set e.Handled to true, and see if that fixes your problem.
25 Aug 2010 by #realJSOP
You can use reflection to query the assembly for class names (as long as that assembly is a .Net assembly).If you need an example, Google is your friend. I would have to google it myself to give you an example. Why don't you cowboy-up and do your own research?
27 Aug 2010 by #realJSOP
A little google goes a long way:Close
14 Sep 2010 by #realJSOP
I'm willing to bet your str param is empty/null.Using the debugger will really help. Honestly. It's already installed on your system (it comes with Visual Studio).
14 Sep 2010 by #realJSOP
You need to learn about pInvoke. The topic is too broad and lengthy to discuss in an answer here. Have you tried googling it?
16 Sep 2010 by #realJSOP
Handle the MouseEnter and MouseLeave events.EDIT ---------------When the MouseEnter event is handled, capture the mouse so you can track it's movement within the control. When it gets to a specific point, do something. When the MouseLeave event is handled, stop capturing the mouse.