Calling Functions In VB 2008?
Oct 26, 2010
I am using Visual Studio 2008 to try and create a calculator program that can convert binary to decimal. I have some code but I'm having problems figuring out what to write as an "argument" when I was to call the function.
Here is the code I have so far.
Public Class Form1
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
[Code]....
View 4 Replies
ADVERTISEMENT
Dec 6, 2010
What I am trying to do is have a class where the functions of the same name are both instance functions and shared functions.
Public Shared Function Get...(byval xx as xx)
and
Public Function Get...
The Public Function uses a Property xx created in the constructor, whereas the Shared Function has the parameters (byval xx as xx).
View 1 Replies
Jul 9, 2011
Are there any functions that can be called across the project.I mean we cn use Private Sub ABC() function in the document where it has been declared but is there any way that this could be called from any other form?
View 2 Replies
Jul 9, 2011
Are there any functions that can be called across the project.I mean we cn use Private Sub ABC() function in the document where it has been declared but is there any way that this could be called from any other form?
View 7 Replies
Sep 16, 2010
im calling functions with an IF statement but then not using the returned value for anything... is there a reason that i shouldn't do this? in my form i call the function to run...
[Code]...
View 5 Replies
Nov 10, 2010
I need to build an application that could run code in private function, based on what user has selected using combobox. For example combo box has three values, One, Two, Three. If user selects one, code written under Private Function One() runs and vise versa.
View 4 Replies
Nov 10, 2010
I need to build an application that could run code in private function, based on what user has selected using combobox.For example combo box has three values, One, Two, Three If user selects one, code written under Private Function One() runs and vise versa?
View 1 Replies
Nov 11, 2010
Below is my code that I want to run. I want to call the same function that user choses from the combo box.
Public Class Form1
Private Sub One()
MsgBox("One is called")
[Code]....
View 1 Replies
Aug 20, 2010
I get this error: Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class.
Partial Class _Default
Inherits System.Web.UI.Page
<WebMethod()> _
[Code]....
I know it has something to do with the fact that the first function is shared and the second function should probably be Public as well but I don't fully understand the reason behind it. Probably not relevant but I'm calling the web method from some javascript.
View 1 Replies
May 4, 2012
I want to see if there is a way to do this... I'm Using vs2010 with the WP7 SDK. (VB.NET)
I am declaring this in the global scope.
public objGame as object then say i have classes: Game1 and Game2 for the sake of the example we'll just say both classes have an Update() function
I want to set objGame = Game1 (or Game2) and then be able to call objGame.Update()
View 3 Replies
Mar 27, 2010
I have a dll whitch init a thread in dllmain.After than, the calling application call some dll functions which register the remote function of the application.function register done, when the thread works and receives and even, it call the program functions (those I stored register before)int C would be like:
int (__stdcall *f_wmif) (char *) = NULL;
INT __declspec(dllexport) __stdcall _DGTDLL_RegisterWMIFunc (int (__stdcall *whitemoveinputfunc) (char *)) {
f_wmif=whitemoveinputfunc;
[code]....
View 1 Replies
Nov 21, 2009
The project requires a form that has textboxes for a students name and the amount of books they have read, and a label where the points they have earned for their reading is displayed. Also a seperate form with About information and yet another seperate form for summary information.
View 1 Replies
Aug 19, 2009
in VB.NET it is possible to omit parentheses when you call a parameterless function. However this can be very confusing because developers could think that a statement is accessing a property instead of a method. this could result in a performance drop if you are calling the method again and again instead of storing the result in a temp variable.is there an option in VS2008 or a compiler option to force parentheses on statements that are calling a method? and if so, would it be also possible that VS will insert missing parentheses automatically if you "format document".
View 1 Replies
Mar 22, 2011
I have a midterm project where we must replicate what our teacher has made, it is a convenience store program. I am having trouble calling the functions, he wants us to use these:
PopulateItems => Populate Items listbox based on the category selected
GetItemPrice => Retrieve the price for a given item
GetItemPriceFromPurchases => Retrieve the item price from the purchases list box (optional. You may not need
[CODE]...
So far I have the first list box populated when the form loads. However outside of that I do not know where to call the function in order to populate the second list box upon selection of the first.
View 3 Replies
Dec 6, 2009
If I have two threads both calling a normal function at the same that appends strings, sometime the output string is a combination from both threads as the function had not finished executing the code before it was called again... Would a shared function wait to finish first?
View 9 Replies
Oct 24, 2009
Here is some example code of what I mean:
vb
Public Class Form1
Private Sub Button1_Click(ByVal sender as Object, e as systemEventArgs) Handles Button1.Click
[Code]....
View 5 Replies
Jan 29, 2007
1) Is it possible to access the Excel mathematical functions without actually opening Excel?
I was thinking of through a DLL WinAPI call or maybe a delegate function or smaller program?
2) Does anyone know of a MS link or area that gives instruction on "how to" use every function of every Windows DLL at all?
Or for all those that Microsoft have chosen to document online at least.
View 1 Replies
Nov 29, 2009
I used to develop applications in VBA, but now I'm using SQL Server 2008 Integration Services for a lot of the functionality, and using VB.NET as the scripting language where needed - all of which are new to me. I need to do the same string manipulation in several different SSIS tasks. With VBA, I'd simply write a function and declare it Public, and I could use it from any module. E.g.
Public Function MakeId(ByVal Country As String, ByVal Postcode As String) As String
....
End Function
' later...
Dim MyId as String
MyId = MakeId(County, Postcode)
But when I do that in a Script Task or Script Component, I find I can't call the function from VB in any other Script Task or Component; it says MakeId is undeclared. It works within its own 'box', but not from anywhere else.
View 3 Replies
Mar 1, 2009
I am trying to pass multiple signature calls to an overloaded function. My understanding is that VB can recognize the different signatures and use the appropriate function.[code]...
View 2 Replies
Jan 17, 2010
how to use Right and Left Functions in VB.NET 2008?
View 1 Replies
Mar 3, 2010
I was curious if anyone has heard of writing a program with functions only. It is part of my current assignment but all the examples I have seen all over have at least subs for the click events. SO I am a little confused to say the least.
View 3 Replies
Apr 3, 2009
Is it possible to have a button do one action the first time it is clicked and a different action the next time it is clicked?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Button1.Hide()
Button2.Show()
[code]....
View 13 Replies
Aug 7, 2009
I'm taking a class in VB, so I have numerous projects. I have a lot of useful functions and code, and I'd like for them to all be included in on piece of code that all my projects can use. The problem with DLLs is that when I build, the EXE needs the DLL to be in the same folder. I want a standalone EXE file. Is there any way I can have a DLL in a different folder than the EXE and still use it? Or is there some better solution to having useful code somewhere so when I update that code, it will affect all of my projects?
View 2 Replies
Apr 17, 2009
I have a countdown timer, I want to make a sound every two minutes at the moment i've got it set to if timer.txt = "00:08:00" minutes then play the sound but it stutters..
View 2 Replies
May 21, 2010
I have this script that reads the accelerometer on my m200 tablet pc but I don't know how to use it in a windows form, how to import or declare it it would be nice.
The .cs script is
using System;
using System.Runtime.InteropServices;
class Accel
[Code].....
View 10 Replies
Oct 10, 2009
I am trying to learn how to use message boxes. I am just starting out but really enjoy it. My basic structure is to have seven yes/no questions that change a variable(x) by adding + 1 to everytime you get the question right. My question lies within the message box and getting my variable to change with every question (or not if wrong button is pushed). Heres what I have coded so far...
HTML
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClick.Click
Dim x As Integer
Car(x)
[code]....
I have been getting no output and when i debug All values of x are 0. I only have one return and it is at the very end of the Car Function (Return x).
View 6 Replies
May 14, 2010
i have an application that's in development, but some modules of the application are already built, so the application it's installed in several computers. In my code, i call an external class that i built with several functions that i use in multiple applications, in this class i have a small piece of code that checks in the network (internal), if a new version of the application (Msi File), of the current application it's available, and if it's available, it runs the Msi file.
msiexec /package MSIPackage.msi That worked fine in windows XP, but now some machines have been upgraded to windows 7, and the user need other credentials to run the package. (Elevate Privileges). Other problem it's that in my application i create several folders in the installation and the user doesn't get any permissions to write in the folders.For example i have one Log folder, and i can't write any logs to it.
View 1 Replies
Jan 8, 2009
This was sort of discussed in another topic i made, but it went a little off topic, so i'm making a new thread. Anyways
vb
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim archiveHandle As IntPtr
Dim archiveName As String = "C:Users#DesktopWarcraft IIIwar3.mpq"
[code]....
Notes:I Also have a feeling it has to do with the flags on MpqAddFileToArchive, because i'm using 0 but the documentation has flags like MAFA_COMPRESS, though i have no idea how to use them?
View 6 Replies
Feb 19, 2009
While converting types, I have found myself using both VB functions and BCL Convert.To* methods.
E.g.)
Cstr() vs. Convert.ToString()
CInt() vs. Convert.ToInt32()
CDbl() vs. Convert.ToInt64()
etc...
Are there any subtle differences that should be noted?
View 1 Replies
Mar 4, 2009
Is there a way to see exactly what the functions are doing. What i mean is there a way to see the class? I know what it does, i just want to know the code.
For example the function: Membership.FindUsersByName()
View 1 Replies