Accessing Class Obect From Another Form Within A Project?

Jul 22, 2009

I have created a project, and with form3, created a class for datagridview called MyDtGrd.nd when I created a form4 I used that same MyDtGrd. When I used before to publish the program no problem.But after publishing When I tried to make changes, giving error like"The variable MyDtGrd is either undeclared or was never assigned"Is there any technique to access the same class oject to use in other forms?

View 1 Replies


ADVERTISEMENT

Accessing A Form In A Different Project?

Nov 30, 2011

how to access a form in a different project but within the same solution? Say I click a button on one form to display another form which is a part of the same solution but resides in a different project.

View 11 Replies

Accessing A Form In One Project From Another Project?

Feb 11, 2010

I have a number of projects in a solution and want to be able to access forms in all of the projects from a form in the main project. I thought of doing this to keep each segment of the solution manageble. If something goes seriously wrong in one of the projects it is easier to fix that starting from scratch with the whole solution.I have found numerous suggestions on this topic from "It cannot be done" to suggestions that do not work. The closest that I have come and still does not work is as follows:

Imports VAT_List.Form1 'This is Form1 in Project 2
Public Class Form1 ' This is Form1 in the Main Project
Private Sub ListsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListsToolStripMenuItem.Click
'Imports VAT_List.Form1

[code]....

View 2 Replies

User Control Accessing A Form Within The Project?

May 1, 2010

I have a "windows form" user control--that is, not on a web page etc. This user control has a form within the user control project. However, code from within the user control can't 'see' the form even though it is a public class---I don't understand why this is the case.

So how can I access the controls (a couple of radio buttons) on the form from code within the user control? I tried creating public properties on the form to return the state of the radiobuttons, but this still doesn't work. I get a "Reference to a non-shared member requires an object reference." error

Should I not be able to see the form since it is a public class?

View 2 Replies

Accessing Function In Alother Class From The Main Form?

Feb 12, 2011

I have a new solution with 5 projects inside. a data access layer, database, 2 class libraries, and the main form. These are all components that I had worked on to get to this point of combining into 1 solution. Now what I have run into is I can not the actual functions in the class libraries. I can get to the class level, but that is it. ere is a sample line of code I need to get working. Once I get this one line, the rest will be obvious: Temperature is on the main form. get for options is "Equals, GetHashCode, GetType", etc... Before this I had bult, compiled, and referenced these classes separately, and it worked fine. I know this is going to be an easy answer, I'm just not seeing it for some reason.

View 15 Replies

Create A New Instance Of Security Class For Every Form In Project?

Feb 19, 2009

I'm creating what I believe is an mdi app.I have a login form.I have a class for security.My login form creates an instance of the security class. There are all kinds of security parameters for each user (permissions to different things, etc.)These parameters are part of my security class.Once the user logs in, many other forms will all be opened and closed within the main mdi frame.All of these other forms need the information of the security class to know what the user has permission to do.Do I have to create a new instance of security class for every form in my project? Isn't there a way to store this stuff globally somehow. Retrieve once from the db at the start of the app during login and just get it from this global area everytime?

View 2 Replies

.net - Accessing Property Of A Class Without Inherting The Class

Apr 7, 2012

I have a class that has the following property that is generated by the methods in the constructor.

Public Class clsLoadTables
Private _ds As New DataSet
Public Property ds() As DataSet
Get

[CODE]........................

My problem is that I do not want to inherit this class, but I have other classes that need to access the ds DataSet property. If at all possible I would like to not use inheritance and not load my datatable more than once in the program.

Here is my failed attempt to access the property inside another class that is not inheriting clsLoadTables:

[CODE].........................

How I can access this dataset that I want to load only once in the program from many classes without using class inheritance or a global module?

View 3 Replies

Database Accessing An Initiated Class From Another Class?

Oct 9, 2011

I have the following defined in my "Form1":So that I can access all my database functions anywhere in the main form (database connection is initialized via the "private sub new()" function in the DatabaseManager class.The works fine for all queries done in form1, however I have many other classes I'd like to be able to access the database from.Does anyone know how to access the initiated class in my example? Since right now it is initiated in the main form, if I try to access any functions inside any ot

View 4 Replies

Microsoft Speech Obect Library?

Dec 6, 2011

Microsoft Speech Obect Library

View 2 Replies

Not Able To Find Microsoft Speech Obect Library

Dec 31, 2009

I am using vb 2008, and I am not able to find the microsoft speech object library. I have gone to Project > Add Reference... > COM tab and looked for it but it is not there. Am I missing something? Will anyone be able to help me find the or download and install the Microsoft Speech Object Library?

View 3 Replies

Accessing DataSets Throughout Project?

Dec 3, 2011

I have declared a dataset (let's call it 'Fred') as public in a VARs module. In the main form in a sub routine called at the start of the project I connect to an Excel spreadsheet and read it into the 'Fred' dataset into one table (called 'Table') I then bind the dataset table to a datagridview and I can see the spreadsheet. Which is very nice :-)

Having loaded the dataset I want to be able to get some values so I created a button and used the following

msg = Fred.Tables("Table").Rows(0).Item("Name")

I think this should get the value in the first row and in the column called 'Name' in the table called 'Table'

But I get an error when I click the button 'Object reference not set to an instance of an object' which I think means I need to use the 'New' keyword...

So I added to the button

Dim Fred = New DataSet

But I get the same error.

Now I have to admit that I've never really got my head around how to use the 'New' keyword and would have hoped to be able to get data from a dataset through my entire project - especially as I've declared it as 'Public'. Surely if I use 'New' all over the place then I create new datasets

View 3 Replies

Accessing Classes In A Separate Project

Dec 6, 2010

I have coded two seperate VB.net windows forms application as two seperate projects in seperate solutions. I now want to combine one project called "Reporting" into the other project called "AnalysisApp" and be able to call the Reporting apps main form.The Reporting app utilies a whole load of controls from DevExpress which are not included in the "AnalysisApp" I have added references in "AnalysisApp" to the DevEpress controls and also to the Reporting app, as well as combining the Reporting app into the same solution, but when I build the "AnalysisApp" it fails saying that it cannot find the DevExpress DLLs

View 3 Replies

VS 2008 Accessing Txt File In Project?

Apr 21, 2011

I have added a txt file to my project, how to access it.

This is what I thought it would be, but it is not correct,

Dim reader As StreamReader = New StreamReader(Me.Airports.Txt)

View 2 Replies

Accessing MySQL Database From 2008 Project

Feb 17, 2010

I developed a project in VB.NET..In this project I want to use data from MySQL that is resides in my WEB Server.I can communicate with the MySQL server of my localhost but can not communicate with the WEB Server.In my CPanel I added Host from the Remote Database Access..But I can't communicate with WEB MySQL Server.

View 2 Replies

In-project Components Fail If Project Is Opened With In-project Component Used On Initially Open Form?

Dec 20, 2010

Public Class ExtendedDateTimePicker Inherits DateTimePicker

View 5 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

VS 2008 - Timer - Project A References Project B So Can Open A Large Form In Project B

May 5, 2010

For reasons that are beyond my control, I have three Projects. Projects A and B reference project C. Project A references project B so that it can open a large form in project B. I now need to open that large form from project C, but VB won't allow me to add a reference from C to B because that would create a circular dependency. I found a way around it, though. I created a Timer in A, and when I opened C from A, I passed in that timer. When the user performs a certain action, I enable the Timer from A, and this causes C to open B for me.

View 2 Replies

Asp.net - Accessing External Final From Project Directory ASPX

Mar 11, 2012

I am trying to access the types file from the project directory for the web root directory. Currently it only accesses it from the C:/, how can I have it access this file from the web root. I would like the file to be in the project folder as types.txt.

[Code]...

View 1 Replies

.net - Accessing Class Properties In Xaml?

Feb 18, 2010

I've currently created the class below. For some reason though I can't access the properties I've created through my xaml style.

Public Class Ribbon : Inherits Button
Private mpopDropdown As Popup
Public Property Dropdown() As Popup

[Code].....

but they don't seem to expose the property either. I've also tagged the property as <Bindable(True)> but that didn't seem to do anything.

View 2 Replies

Accessing And Using Array In Class Module

Mar 1, 2010

Any some simple examples of how arrays can be put in a Class Module? The examples should show how the array is used and accessed in a form.

View 3 Replies

Accessing Arrays In A Class Via Properties?

Apr 8, 2010

Is it possible for one class to access an array of values within another class as a readonly property of the second class? All of the examples and references on class properties imply that one can only retrieve one value by calling a class' property.

View 2 Replies

Accessing Instance Of A Class Through A Variable?

Nov 12, 2010

i have

VariableA as Class1
Variable1 as string
Variable1 = "VariableA"

I want to be able to use Variable1 to get access to VariableA(?).

So i want to able to do something like

VariableA.Property1 = "test"
But like this:
Variable1.Property1 = "test"

View 5 Replies

Accessing Textbox Input In A Class?

Feb 20, 2012

I am new to VB and am having a little trouble with my class assignment. Basically it is supposed to take an invoice subtotal - find the discount percent and give the real total. I cant seem to get my class to access the textbox for user input and it just keeps returning 0's. This is a homework assignment as well... im not asking for the answer just some tips because i am truly at a loss and cannot figure this out

This is my code from the button click event:

[Code]...

View 1 Replies

Accessing Two Dimensional Arrays Within A Class?

Aug 30, 2011

Ive currently got this:

Public Class World
Dim StringA() As String
Property SetString() As String()
Get

[code]....

I need StringA to be a Two-Dimensional Array. I've played around with it and was unable to figure it out..

View 6 Replies

Communications :: Accessing A Class Function?

Oct 28, 2008

I am working on this project and this question seems to be stupid, but I am not really getting the point.I have the following class:

Code:
Public Class ConnectedServer
Public MYPORT As String = "8000"

[code].....

View 13 Replies

IDE :: Windows Forms Classes Appear As Class Modules Not Form Modules In Project Explorer

Jan 7, 2011

Yesterday I opened Visual Studio (2008 v 9.0.30729.1) and all the winform classes in my project display with class module icons with the little 'VB', instead of form module icons with the little form icon!

When I double click on a form module, the form designer doesn't open, just the code module.

When I run the project, it runs fine. There are no errors. The project builds fine.

I did Project --> show all files, and I can see the designer and resx files below the form module which doesn't look or act like a form module.

I can't open my forms to design them!

View 1 Replies

.net - Accessing A Public Class From Global.asax?

Aug 5, 2011

I would love to implement the asp.net routing but i have a basic question.

In my Generic handler i have the following Global class

Public Class MyHandlerRouteHandler : Implements IRouteHandler
Public Function GetHttpHandler(requestContext As System.Web.Routing.RequestContext) As System.Web.IHttpHandler Implements

[Code].....

View 1 Replies

.net - Accessing A TextBox Control From Another Class/thread?

Apr 16, 2011

im trying to access a richtextbox from another class and thread then the ui and i cant seem to get it working. I currently have the sub thats handling the the work inside of a public class and its a sharedsub, im going to be calling it from several different classes and threads but again i cant seem to get it working. the code looks like this. Public Class SharedSubs

[code]...

i would be calling sub using SharedSubs.Console("stringstring") when this is called from the ui thread it works fine but when its called from anyother thread or class its does nothing,ive confirmed it going thru this code but its not displaying anything in the textbox and its not thru an exception due to delegates either which i figured it would.

View 2 Replies

Accessing A Class Persisted On A Hard Disk

May 30, 2009

once a class has been persisted on an hard disk with a strem is it neccessary to load the full class to deal with one part of it or is it possible to get just the part of the class i am interested in?

View 2 Replies

Accessing A Public Shared Variable From A Different Class?

Jan 10, 2012

I currently have two forms, and I need to share the value of a variable in one of them.

I declared the variable to be 'Public Shared', and assigned a value to it. However,

when I inspect the value it appears as 'Nothing'. Here is the snippet:

Public Class A
Public Shared sVar As String = Nothing
Private Sub A_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code]....

View 4 Replies







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