VS 2010 - Difference Between Dims, Private Consts Etc
Jul 8, 2011
I always used to define variables like Dim xxxx As yyyyy. In the tutorials I'm looking at though they do Private Const xxxxx As yyyyy. I wonder just what is the difference here? What is the significance of this change? What am I actually doing with 'Dim' and what is this Private Const doing different?
give me a good resource that explains the difference between a Private, Public, Shared Functions/Sub/Variables? I normally use Public for Subs/Functions inside of Modules I call from other parts of the program. But I'd like to get more of an understanding of how and when to use them. I want as little as impact to a system that is running my programs as possible, so i guess the key here is I'm trying to just get more proficient in my coding.
explain me the difference between them? I'm new to visual basic, and I need to know the very basic things in Visual Basic allowing me to become a professional User
if for example i have two private sub I declared a local variable on private sub a... is there a way that private sub b could use the variable created on private sub a? Im asking because im in a problem in my app were using global variable is not an option to make the long story short
There are a lot of games that many languages can be coded in.MapleStory, WOW, FlyFF, and more. Can we do this on Visual basic?I mean we can. We just need a packet system, like to send the getHello packets and ****.
In the following code as you see I am defining myFile inside the timer sub; which of course is not a good idea. The FilePath is derived in form load before the timer kicks in. How can I declare myFile globally so it can be used in timer sub as well as in form load?
Private Sub tmrInterval_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrInterval.Tick Dim myFile As New IO.FileInfo(FilePath) If myFile.Exists Then ... ...
I want something like this:
Public Class Form1 private myFile As New IO.FileInfo()
'but I do not have strMessageFilePath value yet, that will be achieved in form load.
In Vb6 you could make a private type by doing the following:
Private Type PointAPI X As Integer y As Integer End Type
Vb.Net doesn't support this. I need it to store the x and y position of a certain pixel. I know i could just declare an x and y variable but i would rather use something like:
I've been using VS 2005 for quite some time and will be jumping to VS 2010 shortly. Are there any gotchas to be concerned about in making that transition? Is this a side by side install?
I have a point in the screen that i want to be the same as the resolution changes. I'll explain better. Look out the example [code] Here I'm trying to get the diference between my own resolution(1280x800[its a notebooks resolution]) and the point in this resolution that i want the mouse to be is 120,540.But when I change the screen size it doesnt work of corse.Are there anyone that can help me with it?
I have 2 listbox's. Both contain a list with urls. I need to compere this listbox's and to optein only the urls that are not repeat. How to do this? Or other option with only one listbox but to do the same, to show only urls that are not repeat.
I am trying to use a free 3rd-party DLL (SmartWIM.DLL - Smartdeploy Imaging Component) which is, essentially, a COM wrapper for the WIMGAPI DLL for creating images of Windows drives.You have to register the dll with REgSVr32 of course Now, included with the installation package is a VBS that does a CreateObject for the SmartWIM object. When I use the VBS I can successfully create an image with the CaptureImage method.However, when I convert the same code to VB.NET and called exactly the same method, the CaptureImage method "hangs".By that I mean it successfully creates an image file but then doesn't do anything else. I am at loss to understand why it would work when run via a VBS and not work in a VB.NET Console application?
I am trying to calculate the difference between 2 times.
So far I have 4 labels.
Label1 = Current date and time. Label2 = Contains the exact time that the application was last closed. Label3 = Contains the exact time that the application was opened.
Label4 = I want this label to say how much time in seconds had elapsed between the application last being closed and the application being opened again, in other words the difference in seconds between label 2 and label 3.
Below is what I have done so far, but despite repeated efforts I can't seem to find a way of getting the time difference to show in label 4?
I am looking to create an application that uses a remote mysql database, takes a picture from a live video stream, and also interfaces with an RS232 weighing scale. I'm just looking for a one or two sentence definition on what the huge differences are between VB Express and Standard.
I am a PHP developer and I have never worked with VB before (well maybe since high school 10 years ago). I am looking to either use vb or c++ to create this, but I have limited knowledge of any programming outside of web programming.
I have a DataTable with two DateTime columns: "start_time" and "end_time".Now, I want to add a third column that calculates the difference between the two DateTimes. But I can't seem to figure out how. I've tried to set the .Expression-value to "start_time - end_time", but it says that "-"-operator is not allowed on DateTime.
I'm trying to obtain the values using the prospective GetValue(s) methods but I don't understand the syntax of the documentation. I'm sending the correct bindings (I believe) to filter the fields, and properties that i'm interested in usually
When it comes to database connections what is the difference between closing a connection & disposing a connection? I'm hoping to gain a more technical understanding of what happens when each is called & the effect on the database.
What is the difference between SendKeys.SendWait and SendKeys.Send?Send obviously will just send they key immediately, but does SendWait actually wait for the message to be processed or does it also send it immediately?The function's name itself is just confusing. Which one should I use if I want to send keystrokes to a 3rd party app immediately, or is there no difference? To me, a few milliseconds is a big difference.
I am pretty new to VB.Net and OOP in general and am picking stuff up every day, but it is so easy to become burnt out with the sheer amount of info. Therefore I am taking it slowly. Yesterday I was reading my book and read that using Dim for class level variables is allowed(if the compiler is set so) but is bad design and I should instead use Private. Dim defaults to private anyway. So my question is where should I use Dim instead of Private?
I am using following code to run a private function.I have two values in my combo box, One and Two and two private functions with the same names, Private Sub One() and Private Sub Two()I want my application to call the function whatever value user choses in the combo box.If One is chosen in the combo box, Private function one should be called.Code is below, that does not work
Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim vrValue = ComboBox1.Items(1)
I have a Form that includes ContextMenuStrip1 and PictureBox called "PicBoxBack".How can I call Private Sub PicBoxBack_MouseClick from the ToolStripMenuItem_Click Procedure??[code]
I have a "Main" module that is sort of the "brain" or "top level" of my project. Basically, I think there are routines that it only should be allowed to call. Some of these routines are in other modules, so I don't know how to make them hidden to everything except the Main module. If the routine is ublic, anything can call it; if it is private then the Main module can't see it. Also the other modules are big enough that I don't feel it would be a good idea to stuff them completely inside my main module. How can I achieve this "private except in one place" functionality?