Calling Functions From One Class To Another And Using Multiple Forms?

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


ADVERTISEMENT

Forms :: Way To Return Multiple Rows Of Data To Calling Method Via Class Property?

Jan 28, 2009

I have this application which has one class. I need to return a recordset of data to the calling form. If i use Properties to return, it can only return only a single value at a time. Right now i'm returning a datareader object with one of the properties.Can anyone suggest a better way to return multiple rows of data to the calling method via Class Property?

View 1 Replies

Calling Class Functions After Declared As An Object?

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

VS 2008 : Have A Class Where The Functions Of The Same Name Are Both Instance Functions And Shared Functions?

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

Calling Methods In Forms From Embedded User Control Class?

Jul 21, 2010

control which will need to be reused in several forms in my program. It basically consists of several buttons in a panel. To start with, what I need to do is get the button values from the control into a text box on the first form. But I don't want to have a method calling the textbox directly from within the control, because then it won't be reusable in my other forms. Is there something I can do in VB like parentform.textbox.append for example, where you can generically call the methods of the form in which the control appears?

View 2 Replies

Forms :: Multiple Forms Within A Class?

May 13, 2010

I'm still learning vb.net, so I'm not terribly familiar with all the terminology, otherwise I would have searched a little harder before posting. I'm working on a program where the user can add various forms to a MDI parent.I would like each of the child forms to be part of the same array, all of the child forms will be of various types.Some forms may display a textbox, some forms may contain a graph, some forms may contain an image, etc.[code]

View 7 Replies

Use An Instance Of A Class On Multiple Forms?

Aug 29, 2011

I don't know how to do this and I've googled this to death.

View 2 Replies

Multiple Forms - Using Data In List From Another Class

Jan 13, 2010

I am trying to develop a vb program where i am using List to store data. I want to use all datas saved in that list from another class. In Class 1, i am trying to include a method that will return my list. And form class 2, i will call that method and get that list. But code isn't working. [Code]

View 2 Replies

Calling Functions Across Project

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

Calling Functions Across The Project?

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

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

Calling Functions With An IF Statement But Then Not Using The Returned Value For Anything

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

Calling Private Functions From ComboBox

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

Calling Private Functions From Combobox?

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

Calling Private Functions Using Combobox

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

Asp.net - Calling Other Functions From A Shared (or Static) Function

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

Calling External Previously Registered Functions From A DLL?

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

Force Parentheses Even When Calling Parameterless Functions ?

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

Add / Implement An Interface To An Existing Class Without Changing Code Anywhere That Call The Class And Functions

Mar 1, 2010

I need to create unit testing project for my current website. The currentw ebsite si written in VB. All unit testing examples are using interface to create mock object. My current VB class does not implment any interface. Can I add interface and implement it to my current class and functions without affecting or changing codes to any pages in my website that call the functions? For examples my current class is like:

[Code]...

View 2 Replies

Calling Functions - Call The Function In Order To Populate The Second List Box Upon Selection Of The First

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

Shared Functions - Two Threads Both Calling A Normal Function At The Same That Appends Strings

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

.NET Multithreading / Calling Invoke On A UI Control From A Class In A Separate Class File?

May 13, 2011

Example:

Two files - TestClass.vb, myForm.vb

TestClass.vb looks as follows:

Imports System.Threading
Public Class TestClass
Private myClassThread As New Thread(AddressOf StartMyClassThread)

[code]....

The result:Application runs, no errors or exceptions.Displayed is the listbox and the Start button.I press the start button and a msgbox says "Not Invoked" as expected and upon clicking OK to that msgbox "Start Button Pressed" is added to the Output listbox control.Immediately following that the msgbox pops up again and says "Not Invoked". I was expecting "Invoked" as a separate thread is trying to use the Output listbox control.Of course this results in the Output.Items.Add being attempted which results in no visible result as the thread is not allowed to directly update the UI control.

View 1 Replies

Call Functions Within A Class Upon Instantiation Of That Same Class?

Mar 23, 2012

Is there a way to call functions within a class upon instantiation of that same class? Basically, I have functions within a class, but I want to automatically call some of those functions simply when there is an instance of the class created.

Basically, I have this structure:

Dim instance as new class
instance.function1
instance.function2

[Code].....

View 1 Replies

C# - Access Class And Its Functions From Another Class?

Apr 13, 2010

This is my first major application using multiple classes. It is written in vb and I know about creating objects of the class and using that instance to call functions of the class. But how do I create an object with constructors to allow another program written in C# to access my classes and functions and accept things from the program.

View 3 Replies

.net - Parent/Child Relationships Failing When Getting Data From Parent Class With Multiple Forms Open?

Jun 24, 2009

I have a main form, and some sub forms, and each sub form can have some sub forms. When I have multiple sub forms open, and I try to get data from the parent form, it returns the data from the wrong parent form.For example I have two instances of Mainform.subform running. If I do something like this in a child form of one instance of the subform. It returns data from the other subform.

dim l = Mainform.subform.listofdata

Edit:I am using visual Studio 2008. Winforms, form designed using designer. In my mainform I am doing this

Protected Friend frmMain as Mainform
frmmain = new mainform

In frmMain I am doing this

Protected Friend frmsub as new Subform'
frmsub = new subform

[code]....

View 1 Replies

Forms :: Calling Forms Across Projects Within The Same Solution?

Jun 1, 2010

I have 5 projects within the same solution file, Im trying to access a form that is part of one of the projects from my startup project.I have looked through the earlier threads and most of them deal with calling forms from within a project.To my understanding ive correctly added the projects to the solution file from File --> Add --> Existing Projects.I have also referenced my Project2 from Project1 but still the intellisense does not let me access form1 of project2 from project1.

View 3 Replies

Accessing Certain Functions In Class

May 9, 2010

I am currently trying to write classes so that I can access certain functions from any form within my VB project.

My class is defined thus:-
Public Class testclass
Public Function showmes()
MsgBox("Hello everyone"")
Return 0
End Function
End Class

I have added the class into my form using this at the top in the form:
Imports WindowsApplication1.testclass
Obviously, WindowsApplication1 being the name of my project, testclass being within a VB file, saved with my project.

I have attempted to call the function from the form using this:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
showmes()
End Sub

However I am getting the error "Reference to a non-shared member requires an object reference." I don't understand why there is a problem, since I have used imports to reference the class.

View 6 Replies

How To Group Functions In An ASP.NET Class

Jul 30, 2009

I currently have a VB.NET class named "Customers" and it's been steadily growing in size and I now have a couple dozen functions in it. Is there a way of maintaining the functions in the same class? Since they still use common private methods, but group them by similarity.[code]I guess I wasn't clear on where I wanted this grouping to occur. I want the groupings to be almost like namespaces/classes in IntelliSense when I use my Customer class.I currently use Regions but they only help when seeing the code, not when using the class.

View 6 Replies

Using Transaction In Multiple Functions?

May 24, 2010

I'm trying to use transactionscope to maintain database consistent. But I'm getting error ('Already enlisted'). I'm using transactionscope in multiple functions. I'm trying to do something like this

Private Function RootMethod() As Boolean
Using scope as New Transactionscope
'Connecting & executing query.

[Code].....

View 6 Replies

Access Functions In The Class Within Another Form

Feb 18, 2011

I am new to .NET 4 and VS 2010. I am using VB 2010 and have made a class and need to know how i can access those functions in the class within another form. So there is a function say of XYZ in the class named classes.vb and need to get to it from form1.vb

View 9 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved