Forms :: Cannot Declare New Form

May 31, 2009

I created a second form in my application and in the first form i wrote:

Dim frmDialog as new form2

But it does not recognize the second form. I tried changing the name and i get the same result.

View 9 Replies


ADVERTISEMENT

Multiple Forms - Declare And Instantiate Second Form On Program Start - Use Button Simply To Show Form?

Jan 14, 2010

I have a program that uses two forms. The program opens to the Main form, and the user can navigate to the other form from the Main form through use of a button. Here's the way I've currently written it: When the Main form loads, it declares and instantiates the other form during the load procedure. When the user presses a button, the second form is displayed by means of the ShowDialog method. On the second form, there is a Return to Main Screen button which closes the second form, bringing the user back to the Main form.

So, here's the structure of the code:

Code:
Public Class frmMainForm

Dim frmSecondForm As New SecondForm

Private Sub btnSecondForm_Click(blah, blah, blah) Handles blah, blah, blah

[CODE]...

Here's my reasoning: Originally, I wrote the code so that a new instance of the second form was created every time the button was pressed. The problem was that whatever data was displayed on the second form, previously, was lost when the user returned to it a second time. Since the user would be switching back and forth between these forms, frequently, I needed that data to persist.

What is the best practice for accomplishing this:

1) Declare and instantiate the second form on program start, as I have done, and use the button simply to show the form?

2) Declare and instantiate the second form each time the button is pressed but maintain the variables on the Main form and pass them ByRef to a custom constructor for the second form? Is this even possible?

3) Something else?

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

Declare A Variable To Be Shared By 2 Forms (classes) In The Same Project?

Jan 1, 2011

I've gone brain dead and can't remember how (where) to declare a variable to be shared by 2 forms (classes) in the same project.

View 2 Replies

Possible To Declare In Dll Interface And Then Use Them In Form?

Oct 31, 2009

I have made dll component and it contains interface. I am executing it in form. The problem is that i would like to use some variables in the form, but I do not like to declare them in there. Is it possible to declare them in this dll interface and then use them in form?

View 2 Replies

Import And Declare Item Into A List And Use It On Every Form?

Jul 24, 2011

how can I all the import and declare item into a list and use it on every form?

View 1 Replies

Declare Events On Class Library (dll) And Catch Them On Form?

Nov 21, 2009

I need set events on a class library and catch them in an form.

For example, I run a sub in the dll and I need "receive" the event that the sub in the class is running.

The dll is creted by me in vb, but i don't know how raise events on it to be catched in the form.

View 2 Replies

Declare Operator As String And Insert Into Access Database Form

Feb 10, 2011

i have problem using insert into query for values = "Import With Pre.Tariff (Asean,Cept,C'wealth)" it keeps saying

Syntax error (missing operator) in query expression ''Import With Pre.Tariff (Asean,Cept,C'wealth'.

it seems is it cannot reads ) and show missing operator but this is a string not operator for "Import With Pre.Tariff (Asean,Cept,C'wealth)" this whole thing is sting from datagridview .. any how to make it insert into database without system prompt missing operator problem ???

which is apostrophere problem i used single quote but system read like dat

''Import With Pre.Tariff (Asean,Cept,C'wealth'.. it drops ')'
G3_select =
"insert into tblrk1stt (JOB_NO, [COUNTER], RES_CODE,
ERR_DESC, REMARK, LINE_NO) VALUES ('" & G3_value4 &
"', '"

[Code]....

View 6 Replies

Declare A Form Level Variable Named IntNumTries Of Type Integer?

Oct 10, 2009

Doing a hangman game for class need to know how to declare a form level variable named intNumTries of type integer?

View 1 Replies

Declare A WithEvents Class In Windows Form Designer Which Is Not Control Base

Jun 4, 2011

I am making a TabStrip control to hold a number of tabs just like TabControl, but only with the tabs, no page. The control has a "Tabs Collection", which stores a list of "Tab" class. "Tab" is not inherited from Control, but each tab has its events. So when the user add a "Tab" in the "Tabs Collection", each "Tab" instance should have a (Name) identifier, which user can access it in the code, and with WithEvents keyword so users can add event handlers to each "Tab". The expected out come should similar to this:

Friend TabStrip1 As TabStrip
Friend WithEvents t1 As Tab
...
Me.TabStrip1.Tabs.Add(t1)

[Code]....

View 3 Replies

Forms :: Startup A Second Windows Forms Inside The Parent Form?

Aug 26, 2010

I would like to know if its possible to start up a second windows forms inside the parent form. Ex: A button is pressed and a new form is showed. I would like to keep that new form inside the parent form, and have it not be able to go outside the parent form.

View 2 Replies

Inherits System.Windows.Forms.Form Is Missing In New Forms?

Mar 5, 2012

When I add a new, empty form to my VB.NET VS9 project, the linenherits System.Windows.Forms.Formis missing.What am I doing wrong here?I thought it would be added automatically.I experienced that some thing get weird if this line is not there (Form_Load is not firing, I think).

View 3 Replies

Inter-form Communication - Form Being Called Form Several Forms Using ShowDialog()

Mar 28, 2011

I have a form being called form several forms using ShowDialog().

1. Is there a way for called form to know which form called it by receiving a code or key from the calling form?

2. The calling form has a gridview. How can the called form pick up a column's value from the currently highlighted row in gridview in the calling form?

View 4 Replies

Forms :: Pass Value From One Form To Another Form In .net Windows Form?

Jan 22, 2011

how to pass value from one form into another form...? for example if i have 1 mdiform and 2 form (form1, and form2) for load form1 i'm using system.reflection.assembly here is the code for load form1 :

Imports System.Reflection
Private Asm As Assembly
Private FrmNama As Form
Public Function GetForm(ByVal FormName As String) As Form

[code]....

after form1 load i call form2 from form1 and from form2 i want pass value, here is the code from form2 to pass value into form1 :

form1.textbox1.text = textform2.text

why value from form2 can't fill into textbox1 in form1?

View 15 Replies

Forms :: Form Settings - Check If File Exist On Main Form

Apr 29, 2011

[Code] I want like to check if a file exist on main form, if not: force open settings form. And then when the user is closing the form with exit button = check if the file exist again. If it doesn't exist, close application. It's a huge application and I need optimized on most parts. Also, the settings form is asking the closing question two times.

View 1 Replies

Forms :: Press Down Key Shooter Moves Down The Form And Disappears Off Of The Bottom Of The Form

Apr 4, 2011

For a while i have been playing a guessing game with this line of code.

If Sdown = True And Shooter.Top >= Me.ClientRectangle.Height Then
Shooter.top += Shooterspeed
End If

Basically i have a shooter on the form and whenever i press the down key the shooter moves down the form and disappears off of the bottom of the form. I have been trying to get this to stop for some while.

View 5 Replies

VS 2008 Passing A Form - Get The Error.'cmbDataTable' Is Not A Menber Of 'System.Windows.Forms.Form'?

Nov 26, 2010

I'm upgrading a project from VB6 to VB2008.I have a routine that clears a combo box, named 'cmbDataTable' which could be on any form. I pass the form and the combo box is cleared.


[code]...

I assumed it would be the same in VB2008 but I get the error.'cmbDataTable' is not a menber of 'System.Windows.Forms.Form'I am working my way through the project, first updating the global procedures - this is one - I haven't written the calls so cmbDataTable doesn't yet exist.

View 7 Replies

C# - Update And Get Values In Windows Forms While Moving One Form To Other Form?

Nov 30, 2009

How can I update and get values in a Windows Forms application while moving one form to other form (like cookies)?

I need to update the values to some variable and again I am going to refer stored values and need to do some calculations.

I have used cookies in ASP.NET but I am not able to find out the same concept in .NET Windows Forms (C#).

How can these issues be resolves?

View 4 Replies

Forms :: Main Form Minimized After Opening Form In A Different Thread?

Jun 7, 2009

In the main form the user can choose to download information from a device.Since this request takes time, when "download information" is pressed I open new form in a separate thread: Private Sub RunDownload()

[Code]...

View 3 Replies

Forms :: Make A Model Form, And Copy That Form As Many Times?

Mar 28, 2009

I'm making a program like PostIt! Well, i want to make a model form, and copy that form as many times i want.I think it works with something like frmPostit1 = frmModel.clone()

View 2 Replies

Forms :: Open A Child Form - Main Form Is Unresponsive?

Apr 20, 2011

When I open my child form,

frm_Analogs.ShowDialog()

It opens up the new form, but now I can not interact with my main form. It will not accept focus or allow me to interact with it.

Do I need to change the form type?

View 4 Replies

Forms :: Update Data In A Text Box On Form 1 From A Textbox On Another Form?

May 15, 2011

I was using 2 forms, the first one has general data capture and the second one is a calendar form. On Form1 I have mulitple windows controls. A Textb ox and beside a Calendar button. When I click on a Calendar Command button, it should open calendar form and once the user selects the date, the date should be placed in the text box on the form1. Identical to this on Form1 I need multiple textboxes that needs date to be captured.I cannot use a global variable for this as I need to validate mulitple text boxes. To explain this, I have a Transaction Date and Date Received. I need to validate whether Transaction date is prior Date Received or not? I dont want to use several global variables b'coz I might need multiple validations as above. Please help me on this.

View 6 Replies

Forms :: [2005] Form-To-Form ComboBox Item Defaulting?

Jan 18, 2011

I have been creating a call management application and I am having a problem with something that I have spent weeks on trying to get working and nothing I try is working for me. My application is an MDI application written in VB.NET 2005 Professional, using .NET Framework 2.0. It uses a back end database using Microsoft SQL Server 2005.When the MDI application launches, a form is displayed to the end user asking for phone number (MaskedTextBox) and a partner name. The partner names are within a ComboBox.

When the end user types in the phone number and selects a value from within the ComboBox, s/he clicks on the start button. This then opens a second form. The phone number from the MaskedTextBox is to default in a second MaskedTextBox (this I am able to get working without issue.) The partner name selected from the ComboBox is to default on the second ComboBox. This is the part where I have been working on it for weeks and not able to get it to function.

The second form has many ComboBoxes, all of which pull down items from a particular table within the database. Some of them are editable and some are not. The ones that are editable are also auto complete Suggest/Append on the ListItems.I wrote a sub to handle the population of these ComboBoxes and also to handle if they are editable or not. All of this is working. However, my main issue is that I can't get the value on the second form to default to what ever was selected on the first form. I do not get any errors but regardless of what I do, the second form always stays as the first item in the list regardless.

The code I am using is as follows:

<CLSCompliant(True)> Public Sub PopulateDropDownListFromDB(ByVal cboName As Elegant.Ui.ComboBox, _
ByVal TableName As String, ByVal ColumnName As String, _
ByVal UseAutoComplete As Boolean, _
ByVal UseSQLDistinct As Boolean)

[code]....

View 2 Replies

Forms :: VB - MDI - Application That Consists Of Mainly One Main Form - Ranging Form Graphs, Tables, Dropdown Boxes, Print Preview

Apr 7, 2010

I have to write an application that consists of mainly one main form, but several different things I wanna display. Pretty standard I guess. So there is a menu, some controls, and the main stuff below (ranging form graphs, tables, dropdown boxes, print preview, etc). I would like to use it like one would use frames in html, design an object that is limited to a box or panel that I define. The literature I have does not give me a clear idea of how to do this (yet). The most obvious seem to be the use of MDI, open a predefined form with no borders, maximize it before showing and remove all minimize/maximize options. But that does not work so well. The form inside the MDI parent does not fit the size that is given for it when it is loaded. e.g.

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

So my main question is: Is MDI the way to go here at all or are there better/easyer ways to achieve this? If MDI is the way to go, how do I sucessfully restrict a child form inside another object, without giving the user any opportunity to resize (i noticed that I have minnimize/maximize/close buttons, even if I disable them on the child forms themselves)

View 6 Replies

Forms :: Create An Attendance Form In Windows Form?

Oct 1, 2009

How to create a Attendance form in windows form.The form should lookk like this:


1 2 3 4 5 6 7 ..........till 31 or 30 based on month selected
1. emp1

2. emp2

I shud be able to enter attendance for employees.....

View 7 Replies

Forms :: Making Inactive One Form While Working On Another Form

Feb 12, 2010

suppose i have two forms form1 and form2

and i clicked on button which lead me to the form2

i want i shouldn't be able click on form1 untill and unless i close the existing form window(i.e form2)

View 2 Replies

Publishing Single Form Form A Group Of Forms?

May 28, 2009

In my ASP.NET(2.0),VB.NET Project,around Around 150 people are using this site inside the companyFrom these 40 Forms ,Can I to publish one Form (Visitor.aspx) to another site

View 1 Replies

Forms :: Increase A Forms Opacity Without Increasing The Opacity Of The Controls In The Form?

May 30, 2009

How to increase a forms opacity without increasing the opacity of the controls in the form?

View 1 Replies

Forms :: Calling A Function From A Form To Another Form?

Jul 22, 2009

how to call a function from a different form. Like the button click event. i have this scenario. I have a main form and a child form in the main form there is a navigation panel on the left side controlling the child form. What i want is if clicking the add record in my navigation panel will call a function in the child form to execute.

View 1 Replies

Forms :: Control Other Form From A Main Form?

Sep 3, 2009

How to control other form from a main form? For example :

I want to change background color in Form2 after a button in Form1 is clicked.

View 3 Replies







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