Calling Properties Of Form1 Into Another Form (loginform)?

Dec 1, 2009

I have 2 forms, main Form1 and a loginform. When I start the application, first "Form1" is loaded and then with a button click, user can load "loginform" if required to enable/disable some features/controls on Form1.The sequence is like this:

1) Load main form Form1
2) click a button on Form1
3) Load the loginform.
4) enter user/pwd and click OK button
5) enable/disable "GroupBox" control on Form1 if login sucessful.

For this,I made a click event for OK button in loginform, so once user clicks the OK button, I want to call one function which is defined in Form1 as a Public, which enables/disables the "GroupBox" control on Form1. The code structure is like this:in main Form1, i created a function like this:

Class Form1()
Public Function DoThis() ' Function to enable/disable GroupBox control
....some task...

[code]....

I am not able to call the DoThis() function in loginform. Please suggest me with a piece of code how to do this?? remember that Form1 is my main form which is loading first.

View 5 Replies


ADVERTISEMENT

Forms :: Exception On Calling Form1 From LoginForm And LoginForm From Form1

Mar 11, 2010

I have login form as start up form and i call Form1 after successful validation and in Form1, i have close button on click of Close i would like to reset username and password fields on loginform to null. If i add code in form1 below i get exception Dim fmLogin As New LogInForm

An unhandled exception of type 'System.StackOverflowException' occurred in System.Windows.Forms.dll

Make sure you do not have an infinite loop or infinite recursion

I get above on LoginForm below statement Dim fmMain As New Form1

View 1 Replies

Exchagning Parameters - Able To Start With Form1, Move To LoginForm, Then Back To Form1 Taking 2 Variables And The "values"

Apr 8, 2010

I need to be able to start with Form1, move to LoginForm, then back to Form1 taking 2 variables and the "values" they have in the LoginForm back to Form1 and using the variables. I start with the main form (Form1) and have the user enter some information. Once they click OK I have the LoginForm open. After they enter their credentials I will check to make sure they are legal users, then go back to Form1 (here is where I need to take the Username and Password with me) to log onto a server using the same credentails from the login form.

View 1 Replies

Forms :: Form Variable Value Blank / Null When Move From Form1 To Form2 And Back To Form1

Oct 27, 2009

In my window application, Form1 variable eg. Public str as string. value blank/null when move to Form2 and Back to Form1. How to maintain Form1 varable's value when back to Form1 In vb.net if any one know, reply me soon

View 2 Replies

Show The Loginform When Splash Form Colse

Jan 30, 2011

I make a parent form (IsMidContainer=true) name Form1.vb. When form1.vb shows then Splash.vb shown its fine working. But now i want to show the Loginform when Splash form colse. I close the splash form in the timer tick event of progress bar. I start the timer from parent as

[Code]...

View 3 Replies

Calling Data From Form1 Into Form2?

May 6, 2009

Is there any way to pull data from a text box on form1 into form2

For example if Textbox1 = 100

When i click the botton to load form2-

Textbox1 on form 2 ALSO =100?

View 18 Replies

Accessing Form1 Properties From Thread

Sep 26, 2011

I have an exceptionhandler function that basically just writes a line to a textbox on Form1. This works fine when being run normally but the second I use a thread to start a process it cannot access the property. No exception is thrown but no text is written to the textbox:

Public Sub ExceptionHandler(ByVal Description As String, Optional ByVal Message As String = Nothing)
' Add Error To Textbox
If Message = Nothing Then
Form1.txtErrLog.Text += Description & vbCrLf
Log_Error(Description)
[Code] .....

Is it possible to access a form's properties from a thread this way or would it be easier to write to a text file or similar and refresh the textbox properties every 10 seconds or so (Don't see this as a good option but if it's the only way it will have to do!).

View 2 Replies

Creating New Instances Of Form1 With Variable Properties

May 13, 2009

I'm trying to elaberate on some basic examples of .Net programming in using VB. The basic example of creating a new instance of Form1 is:
Dim x as New Form1
x.Show
I've added some OptionButtons to set the StartPosition of the Next Instance of Form1 as well as some Labels that display the Top, Left, Width and Height properties when the new instance of Form1 is Shown.

This is the code I'm using.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As New Form1
If Me.RadioButton1.Checked = True Then
x.Top = 0
x.Left = 0
[Code] ......

View 1 Replies

Calling Win Properties Page Of Selected Network From ComboBox?

Sep 18, 2009

I'm trying to call the windows properties page of a selected network card from a combobox, so it shows the current settings of the selected networkcard. I mean, like if someone would go to the network settings - right click on the appropriate connection, and go to the properties. For a file properties, one can call the properties by using the shellexecuteinfo function.

View 1 Replies

VB 2010 Project - When A Timer In The First Form(form1) Ticks A Progress Bar In The Other Form Goes Up By 1

Aug 11, 2011

Im doing this project but u have a problem. im trying to make it so that when a timer in the first form(form1) ticks a progress bar in the other form goes up by 1.

View 2 Replies

Open A Second Independent Form /Non MDI And Send Data From Form1 To Form 2?

Jun 10, 2009

Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'Para abrir un formulario independiente /Open independent form

[Code].....

View 2 Replies

VB2008: Form1.BackgroundWorker WONT Stop Form1.Timer From Form3 Click

Sep 9, 2011

Using VB 2008:Situation: A Form1.BackgroundWorker calls a Form1.subroutine. That sub starts a Form1.Timer with Me.tmrOK_BlinkForm.Enabled = True...fires Timer code in event: Public Shared Sub tmrOK_BlinkForm_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrOK_BlinkForm.Tick

Form3.Visible = True
Form3.Label1.Text = gNowButtonDispText
Form3.BackColor = Color.White
Form3.Refresh()

[Code]...

There must be a way to do this, I just need the correct BackgroundWorker Syntax send Stop commad to Form1.Timer from Form3.Click_event...all inside a Form1.BackgroundWorker thread started in Form1.

View 4 Replies

Forms :: Navigate From Form1 To Form2. And Then Close Form1?

Feb 16, 2009

I have got 2 forms ----- form1 and form2

i wanted to navigate from form1 to form2. and then close form1

i did the following code.

-sub form1 _ page load
dim form as new form2
form.show()
me.close
-end sub

i also tried -- form1.close() and form1.dispose() but all in vain

Problem is that my form1 is not getting closed

View 7 Replies

When Background Worker Opens Form1 / Form1 Is Not Responding

Jun 12, 2010

I have an aboutbox1 and form1..I also have a button. When I click the button it runs the backgroundworker. My background worker then opens form1.My backgroundworker doesnt just open it, it does alot of other stuff so don't ask why im doing it like that.My problem:When the background worker opens form1, form1 is not responding.

View 3 Replies

Link The LoginForm To The Database?

Jul 18, 2009

i'm using visual basic 2005 and sqlexpress2005. In my Project i use the 3 layer methode . how can i link the LoginForm to the database.

View 1 Replies

Loginform - Set Username And Password?

May 20, 2009

How do i set username and password, and how do i make a function that makes it aviable to change the password and the username from the program??

View 8 Replies

Access Value In Form1 In Another Form?

Jun 2, 2011

Well i meant In Form1 theres an object named NUM in which i have Stored Few values Now i want to use this Object NUM in form2 so that i can display its value in Form2.. ima unable to access it in form2.

View 6 Replies

Change All Properties Of A Form To Properties Of Other But Don't Change Important Properties?

Feb 26, 2011

How to change all properties of a form to properties of other but don't change important properties like Owner,Handle, OwnedForms, Parent,HasChildren,Controls and ... .I have a child form that i want it to provide controls of Form.The background form provides Aero frame and child form is a transparent form in it.I want it because I want to draw buttons with system style in Aero in Windows Forms.This is my own code but it does not work good (ForeForm is child form):

For Each Propertry In ForeForm.GetType.GetProperties()
Select Case Propertry.Name
Case "AeroBackgroundEnabled", "FormBorderStyle", "TransparencyKey", "Parent", "Owner", "ShowInTaskbar", "Handle", "HasChildren", "OwnedFo[code].....

Additionaly:I wrote a great Aero Form.I don't publish current version (1.2) that supports Aero Blur,RealTime Aero Color change,extend Basic theme?

View 13 Replies

Difference Between Form1.Close & Form1.Dispose?

Oct 21, 2010

Which different abount Form1.Close and Form1.Dispose?

View 1 Replies

Windows Forms: LoginForm And MainForm?

Jun 14, 2010

Currently, I have a LoginForm that authenticates a user and it works fine. I have a MainForm, which is displayed if a valid username and password is entered. I have done this by using the following code in my LoginForm:Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles

[Code]...

Now this does exactly what I want except I fear it's a work around and it's not the best approach. Also, note that I am using Me.Hide() to hide the LoginForm, is there a way to show the MainForm and then close the LoginForm instead of hiding it? Doesn't Me.Hide() call creates an overhead?

View 7 Replies

Save Form1 As Multible Form In .NET?

May 29, 2012

1) At run-time, i want save form1 as Multi Form(Form1,Form2,Form3..etc) with different data,

2) If click load button then it should show all Forms Name(Form) in the ListBox then when click any Form from ListBox then it should open

View 5 Replies

Traverse Data From Form1 To Another Form?

Mar 4, 2009

im working on windows application.In this Application iam using two forms one form is for save and modifying the details of the Patient. This First form contains a 'Find Patient' Button .when we click on button. new form will be open code in the 'Find Patient' button click

'open a form2 from form1
dim f2 as new form2
f2.show

In this form2 iam searching for particular patient according to their Id and retrieveing all the details of the patient in a datagridview wat i have to do is when i click on any cell in datagridview of a particular employee . the details of the particular employee should be shown on the first form1 by hiding this second form2'code in the datagridview_celldoubleclick()

Private Sub grv_Patientdetails_CellDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grv_Patientdetails.CellDoubleClick
Try

[code].....

data will be retreiveing correctly. but it is opening in a new form but already old form1 is opened beneath the form2 ? new form should not be opened and data should be retrieved in the first form which is already opened how should i do this?

View 1 Replies

.net 3.5 - Run 'LoginForm' But Putting Breakpoint But Getting Error IndexOutOfRangeException ?

Jun 9, 2009

Picked up a legacy VB.NET project originally written for version 1.1 of the .NET framework. I'm running Vista with .NET 3.5. I have cleared out all the original error and the project will build; it just wont run.

As far as I can tell, it is trying to run 'LoginForm' but putting breakpoints in doesn't work because the error is thrown before the breakpoints are reached, regardless of where in the file they are placed.

[code]...

View 2 Replies

Assign Form1 Control To A Form Object?

Mar 3, 2009

think i have 2 form & one module..
form1 (has one button name button1)
form2 (also has one button name button1)

[Code]....

View 2 Replies

Open Selected Data From Form1 To Form 2?

Aug 2, 2011

i have my database table in textbox i want to add a comment button when they click on that it should open a new form with another textbox from the same table.my problem is i cannot get it to load the selected rows comment colum.

My table is containing for example, username, password, name, surname and comment

on form1 i have username, password, name and surname with a button that should open form2 with comment with multilines.so if i have selected a username for example test and i click on comment i want to add data to the username test.

View 2 Replies

Form In A Form - Manipulate The App's Properties Place Inside Child Form?

Dec 23, 2008

The following code does create a form within a form and does place NotePad inside the child form. You have to manually start NotePad prior to execution (I work on that later) but the code does workŠ My problem is now I want to manipulate the properties of notepad i.e. focus, size, location, etc. but I cannot figure out how to reference notepad and its properties.

[Code]...

View 8 Replies

Insert LoginForm User ID And TimeString Into Access Database?

May 29, 2010

cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsKashifDesktopDesktop itemsvalid.mdb;")

View 2 Replies

How To Load Data From Form1 Datagridview To Another Form & Update

Jan 30, 2011

All I want is to update the selected row data in form1 to another form2



Form1 Objects
Form1 = MainAppForm
DataGridView = DGVMain <= binded
Button = btnUpdate

Form2 Objects
Form2 = frmUpdate
Button = btnSubmit
15 textBoxes = you can see its name in the code below and all of them are data binded


MainAppForm Code
Pass the selectedrow data to form2 (frmUpdate)

Private Sub btnUpdateDouble_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click
If DGVMain.SelectedRows.Count = 1 Then

Try
frmUpdate.ItemIDTextBox.Text = DGVMain.CurrentRow.Cells(0).Value.ToString()
frmUpdate.PartTypeTextBox.Text = DGVMain.CurrentRow.Cells(1).Value.ToString()
frmUpdate.PartNameValueTextBox.Text = DGVMain.CurrentRow.Cells(2).Value.ToString()
frmUpdate.PackageTypeTextBox.Text = DGVMain.CurrentRow.Cells(3).Value.ToString()
frmUpdate.QuantityTextBox.Text = DGVMain.CurrentRow.Cells(4).Value.ToString()
frmUpdate.UnitTextBox.Text = DGVMain.CurrentRow.Cells(5).Value.ToString()
frmUpdate.DescriptionTextBox.Text = DGVMain.CurrentRow.Cells(6).Value.ToString()
frmUpdate.LocationTextBox.Text = DGVMain.CurrentRow.Cells(7).Value.ToString()
frmUpdate.ProjectBoardTextBox.Text = DGVMain.CurrentRow.Cells(8).Value.ToString()
frmUpdate.CommentsTextBox.Text = DGVMain.CurrentRow.Cells(9).Value.ToString()
frmUpdate.OrderCodeTextBox.Text = DGVMain.CurrentRow.Cells(10).Value.ToString()
frmUpdate.CurrencyTextBox.Text = DGVMain.CurrentRow.Cells(11).Value.ToString()
frmUpdate.UnitPriceTextBox.Text = DGVMain.CurrentRow.Cells(12).Value.ToString()
frmUpdate.SupplierTextBox.Text = DGVMain.CurrentRow.Cells(13).Value.ToString()
frmUpdate.ManufacturerTextBox.Text = DGVMain.CurrentRow.Cells(14).Value.ToString()

frmUpdate.Show()

Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
ElseIf DGVMain.SelectedRows.Count = 0 Then
MsgBox("Please select one item to update!", MsgBoxStyle.Information, "Update")
Else
MsgBox("Updating multiple Items is not allowed!", MsgBoxStyle.Information, "Update")
End If

End Sub



Form2 Code
I want to update the data by this code, but it refresh only the data in Form1

Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

Me.Validate()
Me.SparePartsBindingSource.EndEdit()
Me.SparePartsTableAdapter.Update(Me.InventoryDBDataSet.SpareParts)
'Refresh
MainAppForm.SparePartsTableAdapter.Fill(MainAppForm.InventoryDBDataSet.SpareParts)
End Sub




No problem in updating the data if I put the code below in Form2 load event

Me.SparePartsTableAdapter.Fill(InventoryDBDataSet.SpareParts)



but the problem is, it will refresh all the data in the Form2, and my code in Form1 becomes useless.




Thanks in advance!

View 1 Replies

Difference Between Form1.show Vs Dim A As New Form1

Jan 9, 2010

I have these code in my project one from my lecture one that i did myself [code]what is the difference between "dim" something as new form than using the form name straightaway?

View 2 Replies

Display Date And Time On Top Of The Form Where Normally Written Form1 Forms Name?

Jun 6, 2011

I want to display date and time on top of the form where normally written form1 forms name. i want to display date in formate of for example 23 August 2010 and time in this formate 12:33:20AM

View 7 Replies







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