Forms :: Using A Class In A Win App?

Dec 30, 2009

I am creating a win app that uses a class. Every time I try to fill a property or read a property of the class I am getting an error that there no instance of the object.

I have a web app that I am also building that I have dozens of classes in and have no problems what so ever so I am at a loss as to what the issue is. Here is my code.

Public Class clsdups
Private mintid As List(Of Integer)
Private mstrname As List(Of String)

[Code]....

View 1 Replies


ADVERTISEMENT

Error - Base Class 'System.Windows.Forms.Panel' Specified For Class 'MenuButton' Cannot Be Different From The Base Class 'System.Windows.Forms.UserControl'

Mar 12, 2010

When I do this

Public Class cInherits : Inherits Panel

I get this: Base class 'System.Windows.Forms.Panel' specified for class 'MenuButton' cannot be different from the base class 'System.Windows.Forms.UserControl' of one of its other partial types.

How do I inherit?

View 4 Replies

Forms :: Initialization Of An Array Of A Class Within A Class?

Nov 3, 2011

I have main class of Races with mulitple properties. One of those properties has been defined as another class Runners.

So I have a race with multiple runners and when I try to update the data i get an instantiation error.

For the life of me I can't get it to work.

This is what I am trying to do...

In the clsRace class I have defined :
PublicProperty clsRunner(ByVal index AsLong) As clsRunner
Get

[Code].....

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

IDE :: Excluding Forms To Convert A Window Forms Application To Class Library Application

Jan 16, 2012

I am not able to find the Exclude Command in VB 2010 Express. I have no idea which version of Visual Studio it is working with. I've got one 217MB VB 2010 Express file and many 2008 VB Express files with one of them measuring 31 MB. There many other SQL files and .Net Files.

View 4 Replies

Forms In Class Libs?

Oct 23, 2009

I have a solution that contains several class Libs that are called by a main windows app.

One of these libs (Utils) has a form that I display to provide feedback. It's content is controled via properties in the class as is the show/hide actions. The form is declared as "Public lfrmMsg As New frmMessage" in a module with the class project.

The first time I call the form it works fine. However after calling the hide property (calls lfrmMsg.hide) I can no longer show the form as it is disposing.

My objective is to have a single instance of this form that can be called at different times and by different classes/apps.

View 2 Replies

Forms Inheriting From A Class?

Jul 3, 2010

I've created a class called connector. By clicking on project and adding a class.And I want to inherit from that class in the forms But I get this error.

Base class '<baseclassname1>' specified for class '<partialclassname>' cannot be different from the base class '<baseclassname2>' of one of its other partial types`

what do I do?Here's the class named connect.vb:Imports MySql.Data.MySqlClient

[Code]...

View 1 Replies

Create A Class In Code That Contains Forms?

Mar 18, 2012

To me the answer to this question will be stupidly simple, but I cannot find it. I want to generate child forms to do simple tasks from my main form. I want to be able to create and destroy these child forms as I use the main form. I decided to create a class of the child form, with its own constructors and destructor. When I tried to do this using the Class Library Module, I could not access the Windows.Forms class to create a form.

View 4 Replies

Forms :: Controlling A Timer From Outside Class?

Dec 22, 2010

We've been asked to make a program based on a spec where we enter some details and it will then output a graph.Part of the assignment asks us to set up a timer so that the bar chart will display each bar seperately with a time delay between each one.However the timer is assigned to a form (Form2) while the draw commands are within another class called Expenditure.

While the specification doesn't specifically say we should stop the timer from within the class it is implied.Now I have tried Form2.Timer1.Stop() and Form2.Timer1.Enabled = False within the class without any luck.I'm wondering is it possible for the Expenditure class to stop the timer or does it need to be done within Form2?

View 1 Replies

Forms :: How To Update Progress Bar Within Class

Aug 12, 2010

I am wondering how do I update a Progress Bar that resides in Form1 (for example) from a newly created class called from the Button in Form1. I have read several tutorial about backgroundworker. Most of the googled tutorials have their "long process code" in the do_work event. I have tried them and got it working from within the form itself.

However, there are 2 parts (long process) in which I wish to incorporate the updating of the progress bar; First one being a long sub routine that is in the main form (Form1). The second one is another long processing function that resides in a class. It is the second one that is giving the problem as I have no idea how to call the backgroundworker.reportProgress() to update the UI.

Here is the sample flowchart that I have created for the second long processing function:
I wish to insert a new instruction that says "Update the Progress bar that is in Form1" after the current instruction "Store the member into a collection".

View 4 Replies

Forms :: Pass A Variable From Within A Class

Jun 25, 2011

i have a class called car and within that class i have a few vairables

Public Class car
Public Property Name As String
Public Property ID As Byte

[Code].....

View 5 Replies

MDI Forms Location/Class-function?

Jan 8, 2009

I want to create a function (class?) that will have stored the coordinates(values) of my mdiforms, so I can call it whenever I want to dispaly the mdiforms. I want to avoid retyping again and again (in every mdi form) the above Me.Top=5 Me.Left=150 on forms load.

View 2 Replies

Running Forms In Class Library?

Jun 20, 2012

i have a query iam able to add items in listbox from form 2 to form1 from windows application in vb.net
but iam unable to add items in listbox from form 2 to form1?

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

VS 2005 - Inheritance In Forms From Class

Feb 23, 2010

I am developing a windows based application in VS2005. I want all my form to be inherits from one of my class e.g.ParentClass but indeed the windows forms already inherits windows.forms.form class. what I have tried is that, I inherit "windows.forms.form" in "ParentClass" and all forms inherits my "ParentClass". But in this case when I view the design of the form IDE gives error.

View 3 Replies

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

Forms :: Running Form In Class Library?

Jun 20, 2012

i have a query iam able to add items in listbox from form 2 to form1 from windows application in vb.net but iam unable to add items in listbox from form 2 to form1

View 3 Replies

Forms :: Set Property Of Parent Class From Child

May 14, 2009

I would like to have a form class that is called from a button on a parent form and would like a button on the child form to set a property on the parent form. Can anyone explain the best way to go about this or direct me to a good article?

[Code]...

View 3 Replies

Forms :: Updating UI Label From Another Class In Another Thread?

Nov 2, 2011

I've been programming in vb.NET for a whileAnd to be honest, its turning out to be a real pain.Here is the

Form1.vb: Imports System.Threading
Public Class Form1
Dim trd As Thread[code].....

So, I have a form (form1) with a label on, this label simply reports the status of the thread.The thread begins the Class1.Main() sub, and I have a delegate setup to change the text propoerty of the label.Now,I know the label is created on the UI thread,so I assumed the delegate would work. However,it seems that it updates the .text property, but doesnt redraw the control when .Update() is called .What am I doing wrong?I have found lots of examples of delegates, but all run from within the same class. I want to use threads too, not a backgroundworker! This code is a "simplified" version of a project I am on, which is encountering the same problems

View 17 Replies

Forms :: VB With Implementing A Class In Form Code?

May 8, 2009

I am having trouble with this project I am working on. I am a beginner to vb and have some background in access databases. I will attach my am doing an inventory project. When you execute the form, a main form pops up that allows you to choose Production or Inventory. My issue is with the Production. In the production form that pops up after clicking Production, there are text boxes to be filled out by the user based on the production run.plementing a class that will give the box count based on the box type entered. I have to use a class based on the project requirements.

Basically to calculate the usage, enter in a random number for Pods Produced, then enter in a box type (which is A box, B box, C box, D box, Master Case). I want the Public Class Box Count in the code to be able to be placed in the production form's main class code and calculate the box count based on the box type entered. If A box, box count should be 50. If B Box, box count should be 100, If any other box is typed in, the box count should be 150

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

VS 2005 Where To Declare A Class To Share Between Two Forms?

Aug 24, 2011

There are two forms, first form list's the employees and the second form is used to add,edit the employee record. So to pass the information between the two forms i want to use the Employee Objects.To do so, where should i declare the Employee Class?

View 6 Replies

VS 2010 Forms In Class Library Project?

Jun 17, 2011

I was wondering is it possible to put forms into a class library project and if so could I use those forms as an mdi child from my main forms app?A bit behind what I am trying to do:I am creating a game which is essentially going to have its own 'operating system' As the user progresses in the game they can 'install' new software into their operating system.I have my 'Desktop' that is an MDI Parent and what I want the users to be able to do it when they have purchased a new bit of software (also in game) the game will connect to my central server download a dll and place it in a directory, that is essentially installing the new bit of software and the game will then pick up that dll and add a new button the Programs list and when the user clicks on that software in the Programs list it will launch the form in the Class Library as an MDI Child of the 'desktop

View 2 Replies

Forms :: Class Library Reference Disappearing Upon Compiling?

Dec 30, 2011

I have a solution built of 3 projects:

1. VB.NET Class Library - data access and objects, reusable methods, etc.

2. ASP.NET Web app - web application that references the class library

3. VB.NET Windows Form app - windows app that references the class library

I have no problems with the web app. It referenes the class library and every time the project is built the web app gets a freshly compiled dll from the class library.

My problem is with the windows form app. When I first add the reference to the class library project, I get all of the intellisense I'd expect while coding. When I try to compile, though, it's like the reference disappears and all my code that is based on the class library errors out with "'xxx' is not declared" or "'xxx' is not defined" where 'xxx' is a method or class within the class library. If I go into the project properties, the reference is still there, but the project no longer compiles and I also lose intellisense for all classes within the class library. If I remove and re-add the reference, it works again, until I try to compile. Then the errors occur again.

I've tried creating a separate Windows Forms project and just referencing the DLL created by the class library but get the same problem. HOWEVER, if I create a seperate blank WEB project and reference the dll (or the project), everything compiles fine. It seems to be something with my class library being referenced by a windows forms app.

For reference purposes, my class library has the following references:system, system.cor, system.data, system.data.datasetextensions, system.drawing, system.web, system.xml, system.xml.linq I noticed I can't add a reference to System.Web in my windows forms app, and I wonder if my problem is somewhere in this area. I need the reference is my class library because it passes some HttpContext objects back and forth to a few of the methods.

View 1 Replies

Forms :: Form Object Access From Class Method

Oct 22, 2009

I want a string and a listbox, both which are in a form to be modified by an instance of a class method. Should (could I):

1. Pass the entire form to the class method as parameter.

2. Pass the listbox and the string to the method as parameters.

What's the best approach to get access and modify this string and listbox on the form.

View 3 Replies

Forms :: How To Call Unkown Function In Another Class Dynamically

Jan 20, 2012

I've created a dialog which I'd like to popup from any function or sub in any class or form that I have in a project. It would nice to have it work exactly like a messagebox except it's got a progressbar and a cancel button on it. It's job is to display the progress of other functions so it should just stay open until I close it or the user selects cancel.Now I've found many of the basic examples on the net and have got the dialog working exactly as they have shown it. The trouble is that the examples are using a counter or thread.sleep which simply adds +1 in the DoWork sub. In other words, it validates that a worker thread can update a progressbar but it's a closed loop that only exists in the dialog's class.The examples don't show how to call an unkown function in another class dynamically, they're simply a hard coded 1+1 in DoWork. To me it's not a real world example because it doesn't show how to plug into the dialog or get a communication stream from other classes and functions that are running and wanting to increment the progressbar.[code]

View 3 Replies

Forms :: Set And Get A Value From A Class Property Within The Main Event Of A Module?

Jul 8, 2011

the project uses a submain as startup object which is located in a module, thy so the application will be started in tray. Within the main() event i need to deserialize a xml file and with it set the properties of a class and then set what the application will do.The problem is, after I deserialize it and put set the property values I try to get them in the same event(main) but when it gets the value it returns as nothing(if string) or 0(if integer) but in the debugging i saw it setting the values. Is there a way to do that, within the main() event of a module to set the properties of a class and then get them without being nothing/0 ?

View 3 Replies

Forms :: Update A TextBox When Running A Thread From A Class?

Sep 15, 2011

I am having trouble accessing the main thread (my form) when calling thread is running in a class (or module). I have no problem to manipulate a data (in a thread) from a form, the textbox can be updated using delegate and invokerequired but it doesn't seem as easy when the thread that processes a variable is handled by a thread that is running in a class.

[Code]...

View 4 Replies

Imports System.Windows.Forms In ASP.NET Class File?

Dec 14, 2011

how can i import System.Windows.Forms in my asp.net class file?

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







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