Using the Call statement is more of a readability preference than anything.
Be aware though, that it's only safe to use it on Subroutines, not Functions, as when it's used on Functions it causes the returned value to be ignored.
User Profile
Collapse
-
Renaming files in use.
I write my own update functions/programs for my programs. (Go me. :< )
Occasionally I need to update the /updater/, but I can't rename a file that's currently in use like the operating system does (Test it out, you can rename a file while it's in use). Is there a way to remove it from the stack without closing it so that's possible?
I use VB 2005. -
You must first cast the sender (an Object type) to a Button type (it is in object form because all classes derive from Object)
[CODE=vbnet]
dim testButton as Button = TryCast(sender, Button)
MessageBox.Show ("You clicked button: " & testButton.name )
testButton.Back Color = Color.ColorValu e
[/CODE]Leave a comment:
-
-
Every string object has a method called "Chars()" that allows you to pull out characters at specific locations. In your case, you're using a textbox, so it will be [Object_Name].Text.Chars()
For example:
[CODE=vbnet]dim intFirst as Short = Convert.toInt16 (txtNumber.Text .Chars(0))
dim intSecond as Short = Convert.toInt16 (txtNumber.Text .Chars(2))
dim intAnswer as Short = intFirst + intSecond
Me...Last edited by Killer42; Oct 29 '07, 01:57 AM.Leave a comment:
-
You almost have it. :]
In your button's click procedure put an if statement like so:
Code:If MessageBox.Show("Do you want to close?", My.Application.Info.Title, _ MessageBoxButtons.YesNo, MessageBoxIcon.Question) <> _ Windows.Forms.DialogResult.Yes Then Me.Close()
Leave a comment:
-
Instead of using a mouseMove event, it would be easier to check if the user is actually using the form. You will already have the code in place for what each control is supposed to do, just reset the timer inside each of those subroutines.
Better yet, write one function/subroutine that resets anything to do with the timer and re-use it that way. That's one aspect of programming: code reuse. :>Leave a comment:
-
-
I'm a little perplexed at how you have a diploma (BS or MS?) in Computer Science and don't know how to at least do /something/ in that list. It looks like the Manager, User, etc. is just a class data type.Leave a comment:
-
Could you pack your code into a zip file and attach it? I've never heard of the problem before and would like to get a more visual representation of what it's doing.Leave a comment:
-
Depending on the legal range of numbers you want, just put a number outside said range and check for not that number. EX:
Your legal range is zero or above:
Code:'This can also be accomplished by setting each label in the Propeties tab on the 'Designer page (select them all, set the Text Prop to -1.0). label1.text = "-1.0" label2.text = "-1.0" ...
Leave a comment:
-
Short answer: No.
Long answer: VB stores what files you had open, and which one was currently active when you last closed the project. So if you have your code views open they'll be the ones to show up. Frankly, once I get the UI done, I never open the designer windows ever again.
Confused answer: If you really mean "How do I run a program without using the F5 key?" Then you have two options:
...Leave a comment:
-
Set it up as a Windows Service and it will run in the background....Leave a comment:
-
You're welcome, though I need to mention I made a little typo in the description. Optional parameters must be listed /after/ all required parameters, not before. And still, can not be used if you use ParamArray and vice versa....Leave a comment:
-
Here's what you need:
Code:''' <summary> ''' Compares array values to a given string. ''' </summary> ''' <param name="array1">Required. Array to compare against.</param> ''' <param name="valueX">Required. String value to compare.</param> ''' <param name="retry">Required. Whether or not to try the second,
Leave a comment:
-
Why yes, yes it was I didn't notice it because he said not to pay attention to that routine. :/ Well, code937, if you ever switch to 2005, that's how you do it....Leave a comment:
-
You could have a timer that checks the database every hour or so for new records instead of having it run constantly. (1 hour is 3,600,000 milliseconds if you need to know. :P )Leave a comment:
-
Uh...thanks, but I'd rather not spend $500 to get something I don't need.
Again, I'm writing the program in VB 2005, not C#. The namespace I want to use is in C#.Leave a comment:
-
Because you did not mention what version of Visual Basic you are writing in, I'm going to assume 2005. :)
Anyway, it's a very simple process to extract a string using the String.substrin g and String.IndexOf methods:
Code:Dim address As String = "http://address/file.html#timmy" Dim strMemberName As String strMemberName = address.Substring(address.IndexOf("#")
Leave a comment:
-
Importing C# namespaces into a Visual Basic 2005 application
I'm looking for a way to import C# namespaces (stored in a *.cs file) into a visual basic 2005 application. I'm attempting to write an application that uses DirectX and all of the helper functions and code for it are written in C#.
The normal Imports keyword does not support pathnames as valid assemblies (I may just be doing it wrong, however) to search and the MSDN Library (April 2007 ed.) does not cover how to either.
No activity results to display
Show More
Leave a comment: