Use Form In Class?

Sep 6, 2011

How can i use a form in these application..

View 2 Replies


ADVERTISEMENT

Form Inheritance - Error1Base Class 'MenuStrip' Specified For Class 'Lesson2' Cannot Be Different From The Base Class

Apr 15, 2010

I have put this code in the global form Inherits System.Windows.Forms.Form. And then in the form that will inherit this from the global Inherits MenuStrip. "MenuStrip" is what the global form is called. But keep getting this error: Error1Base class 'MenuStrip' specified for class 'Lesson2' cannot be different from the base class 'System.Windows.Forms.Form' of one of its other partial types.

View 5 Replies

Create A New Class That Inherits From The Base Form Class And Define A New() Method With Parameters?

Oct 1, 2008

I've been creating short test apps repeatedly to try to understand some of the concepts in VB.NET.For the most part it has been illuminating.I read Bucky's .NET knowlegebase tutorial on passing objects as parameters to newly created forms. He shows how to create a new class that inherits from the base form class and define a New() method with parameters Extending the concept I thought about doing the same thing with a form that was created at design-time (In this case Form2).

[Code]...

View 6 Replies

VS 2010 - Et The ATM Class To Instantiate On The Form Class?

Nov 22, 2011

I'm trying to get the ATM Class to Instantiate on the Form class.

[code]...

ISSUE = " 'ThisATM' is used before it has been assigned a value. A Null reference exception could result at runtime"

The Other problem i am having is with a class in the program called CardReader. What am i supposed to type to let the code below be able to "read" the read function on the Form1?

[code]...

View 7 Replies

Form Result To Another Form - Class Contains A Form That Have Buttons

Apr 9, 2010

I designed a class contains a form that have buttons. When i click any button this function runs

Public Sub BtnClick(ByVal sender As Object, ByVal e As EventArgs)
result = CType(sender, Button).Text

[CODE]...

In another project I imported this class. I called the method that shows the form in my class. I need to store the 'result' variable in another variable in the new project. How can It be done.

View 1 Replies

Object Passed ByRef To Form, But Not Accessible Throughout Form Class

Feb 18, 2010

Hi

I've got a pretty general question about the best practice in passing an object reference to a Form in VB.NET. My form is a dialog and I've created an overload ShowDialog method, where I pass an Object into it ByRef.

The trouble is, I want to be able to refer to that Object throughout my dialog Class and not just in the ShowDialog method. For instance, some of my Events for controls on the form, need to reference that object.

I know I could create a local Private variable in the Class and assign it to the passed value, and then use that value. However I'm thinking this isn't very efficient because it would (I believe) create a new copy of the Object (which is a complex, large class in itself).

View 8 Replies

Threading - Access A Value Of A Control Within A Form Outside Of The Form Class

Jun 3, 2009

What is the best way to access a value of a control within a form outside of the form class. I have a lot of functions defined in a module, one of these functions requires a series of values from controls in my main form such as the FolderBrowserDialog.SelectedPath element. I understand that these cannot be accessed in the format form.FolderBrowserDialog1.SelectedPath and that they need to be accessed using a delegate. This is the part I am stuck with.

[Code]...

View 3 Replies

Getting String Value From Form Into Class( Not Another Form)?

Apr 13, 2010

This is my code in my class

Public Class DrawableTextBox
Inherits Drawable
Dim i_testString As Integer

[code]....

View 2 Replies

Class C Inherits Class D Is Class D A Superclass Or Parent Of Class C?

Dec 16, 2009

If Class X is within the scope of Class Y, is X a subclass of Y?If Class A is a sub Class of B, then is Class B considered a super class of A?if Class C inherits Class D is Class D a superclass or parent of Class C?if Class E extends Class F then we can consider Class E a child of F?if Class G inherits Class H and is within the scope of Class I then who is the parent of Class G? Classes that inherits Class J and classes that are within Class J are all sub classes of Class J?

View 1 Replies

Register The Class File - Not Recognizing My Class.Even The Intellisense Is Not Picking Up Te Class

Jul 22, 2011

I have a class (see below)

Imports Microsoft.VisualBasic
Imports System.Data.SqlClient

Public Class ClientProfile

#Region "Variables"

[CODE]...

It is in the file ClientProfile I have placed in both App_Code and also App_Code/Models

In my code behind I have the following

[CODE]...

The last word, "ClientProfile" has the scary squiggly red line below it. It is not recognizing my class.Even the Intellisense is not picking up te class. Do I have to register the class file in any way?

View 4 Replies

.net - Getting String Value From Form Into Class?

Apr 13, 2010

I have a question regarding the some data which is being transfered from one form to my class. It's not going quite the way i'd like to , so I figured maybe there is someone who could help me.

This is my code in my class

Public Class DrawableTextBox
Inherits Drawable
Dim i_testString As Integer
Private s_InsertLabel As String
Private drawFont As Font

[Code]...

I've got a form with a textbox( form1) in which the text is being inserted and passed through a buttonclick (al via properties).As you can see I've placed several traces and in the property of the class my trace works fine , however if I look in my Draw function it is already gone.

View 2 Replies

Get The Form Name When The Class Is Initialized?

Jul 28, 2010

Public Class MyClass
Property Form as Form
Public Sub Mysub1

[code].....

View 11 Replies

How To Draw On Form From Within Class

Jun 18, 2012

I am basically teaching my students about OO programming and want them to be able to see the outcomes to methods visually. I want to draw shapes on a form but cant for the life of me get it to work - no errors but no actual shapes are being drawn. So I have created a method called drawFace which is run when a new instance of the object is created. This method has the following code in it
Form1.CreateGraphics.DrawEllipse(Pens.Black, 100, 100, 100, 50)

It doesn't cause any errors, but it doesn't seem to do anything. Also tried adding a picture box to the stage and ammending the code as such
Form1.PictureBox1.CreateGraphics.DrawEllipse(Pens.Black, 100, 100, 100, 50)
But still no joy.

View 4 Replies

How To Make Class To Use In Form

Aug 20, 2009

I made this class:
Imports System.IO.Ports
Public Class Controller
Dim Serial As New SerialPort
Dim CurrentAzimuth As String
Dim CurrentElevation As String
Public Function Open(ByVal COMPORT As String)
[Code] .....
And I want to use it in a form. How do I call this class "controller" and then what code do I need to use it in a windows form?

View 6 Replies

Using Enumeration Of Class From Form?

Aug 10, 2011

I have a form event that calls a public function in a class. I am trying to use an enumeration that is in the class from my form, but I'm getting a green squiggly line under clRS.enmProcedure.SetReady.

The error says this:
"Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated."

Private Sub dgvResults_CellContentClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvResults.CellContentClick
If clRS.pubfnc_UpdateResults_M(dtResultID, Me.dgvResults, clRS.enmProcedure.SetReady) = "Failed" Then
Exit Sub
End If
End Sub

View 2 Replies

.NET - Startup Class Before The Logon Form?

Feb 24, 2010

I have a VB.NET project and I want to know how I can call a class called StartUp.vb BEFORE my logon form.

Here below is the coding of Startup.vb class

[Code]...

The problem is: I couldn't find a way to call this StartUp.vb file and therefore I am unable to call my LogonUI form, I also try to "right click" the vb project and select "properties" and go to "Startup form", couldn't see the class of "Startup.vb" showing up

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

Build A Class That Works With A Form?

Sep 7, 2010

I am trying to build a class that works with a form, but I keep getting the dreaded "Object reference not set to an instance of an object" Error.The form basically collects test grades and assigns them to a collection.My class code is as follows:

Public Class Scores
Private colScoreCollection As New Collection
Public mintSum As Integer
Public mdecAverage As Decimal
Public mintMinimum As Integer

[Code]...

I had a similar project I was working on that had a collection in it, but now that one is giving me the same error. It there something with my version of Visual Studio that is causing this error possibly?

View 7 Replies

Control Form With Class Library

Oct 27, 2009

I have trouble to control my form using with the class library. I am trying to set the form to maximum and set the form border to none. There is an error in come to the end of the statement next to the test.myform.[code]The error I have received is Object reference not set to an instance of an object.

View 6 Replies

Creating A Partial Class For A Form?

Nov 30, 2010

I would like to create a partial class for my form. I have a lot of events, and it gets messy, so I would like to break up sections into their own files. The problem: When I create a partial class of my form, say:

Partial Public Class Form1
End Class

Visual Studio decides I need another form for this partial class.

1. How do I create a partial class for a form?

2. If I cant do that, how can I break up all the events in my form into different files?

View 3 Replies

Delete A Module , Class / Form?

May 9, 2009

I wonder how do I delete a Module or Class or a Form.[code]...

View 10 Replies

Form Control And Class Libraries?

Jan 14, 2010

I want to create a library (.dll) of custom dialog forms. Which type of project do i make? Class Library, Windows Forms Control Library, other? Whats the difference between the two?

View 3 Replies

Get Code From Class To Update Form?

Feb 14, 2011

I know this is probably a common one, its also quite tricky to know how to get around it (I find anyway).I have a seperate thread, within that thread I have defined an object (of my own class).Obj.UpdateMyForm is called, but how do I get the code from my class to update the form?[code]I found this code online a while back, and it seems to work if I call the sub routine directly from another thread, however, calling it from one of my class sub routines doesn't seem to work.

View 6 Replies

How To Call A Class From A Main Form

Mar 5, 2010

How would you call a class from a main form? In VB6 you would call a module by just simply calling the module name.

View 2 Replies

IDE :: Using A Windows Form .exe As A Class Library .dll

Jun 10, 2010

I have a Windows Form application compiled to a .exe that contains standard classes and one windows form class. I would like to reference that .exe in another project. The dialog to add references shows .exe, I add the file to my project, I can see the classes from that file but when I run the second executable I get a "cannot load type" error when I try to access the classes contained in the referenced .exe

That behavior seems strange to me since the IDE accept the .exe as a reference and even "intelisenses" its classes.

I do this because I want a standalone version of the form, but I also reuse it in other project. Am I doing it wrong, what's the best practice in my scenario? I'd rather not maintain both a Class Library project and a Windows Form project that includes the same code.

View 1 Replies

Open Close Form From Class?

May 29, 2011

i am developing client-server app. i want to hide the opened form and open the another form when i recive the commnd from server. the client side has two form and one class.code(this code execute when i recive the msg):

Sub messagerecieved(ByVal message As String)
Dim msg() As String = message.Split("|") ' if a message is recieved, split it to process it
Select Case msg(0) 'process it by the first element in the split array

[code]....

View 1 Replies

Referencing Another Variable In Form Class

Dec 24, 2011

How do you reference a variable in another Class?
Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = "Class1_Text" ' Would like to replace w/correct code
End Sub
End Class
Public Class Class1
Public Class1_Text As String = "Class1 Text"
End Class
I can reference the Form1 data in Class1 but not vice-verse.

View 8 Replies

Refering To Controls That May Or May Not Be Put Ont Form From A Class?

Jan 31, 2010

I guess this is a general question say I have created a taskpanel class and I have text space in a footer I created. How would I refer to say a button that may or may not have been put on their at design time. I have code like this:-Private Sub Button1_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs)

Dim rv As String
rv = ToolTip1.GetToolTip(Button1)
BorderContainerGood1._BorderDetails.footerDetails.Text = rv

[code]......

View 1 Replies

Return Class Variable On Form?

Jan 27, 2010

I wrote the following two functions in a class to take a gpib reading and also take a measurement from an LCR meter.
HTML
Public Function gpibRead(ByVal Channel As Integer, ByVal buffer As Integer) As String
Dim readingBufferA1 As String
Select Case Channel
Case 1
readingBufferA1 = gpibLCRA1.ReadString(buffer)
Return readingBuff
[Code] .....
When on the main form I call the funtion takeMeasurement(1) how can I get the LCR readings back. If I try and use readingBufferA1 on the mainform it doesn't recognize that as a variable. I know that it is taking the reading and storing the correct numbers because I am monitoring on NI Spy.

View 6 Replies

SetCompatibleTextRenderingDefault In .NET Class Library Containing A Form?

Mar 18, 2009

I have a .net class library with a com class that calls a form. I want to to SetCompatibleTextRenderingDefault(false) to ensure the form fonts look nice.

If I run the command in the class constructor I get the following error:
SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created in the application.

Edit1: To clarify, I get this error when initiating the class from a .net test harness, if I call it from a VB6 app then I simply get "Automation Error"

Edit2: Is the answer that I cannot use SetCompatibleTextRenderingDefault in a com class when calling from a vb6 app?? Maybe it's the "parent" app that needs to call this method and as such a vb6 app cannot?

how can I make the fonts look nice in a .net class library form called from a vb6 app?

View 2 Replies







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