Passing Values From Modal Form To Parent Form?

Aug 11, 2011

I am trying to pass information to parent form from modal form in vb.net winforms application.

1.) I created a copy of a form and displayed it using following code.

dim f=new frmParent()
f.show()

2.) Depending on conditions a button on frmParent opens a modal child form and asks for some informations. I used following code for that:

dim f = new ChildForm()
f.showDialog()

Both code works fine. When user press saves in child form i need to close childForm and use the user types values in parent form. I know how to close the childform but not sure how to pass info from childform to parent form.

View 1 Replies


ADVERTISEMENT

Passing Variable From Windows Form To Modal?

Mar 28, 2012

Windows Forms, VB. I have searched the web for the correct answer to this and no dice. Either they are missing on what I am trying to accomplish or are in CSHARP making it harder for me to see what they are doing. I have a need to pass a record Id from the main windows form into a modal Dialog Load Event.. I have tried throwing a with param in but then I have to change the Load event params and vb flags it.. I am trying to pass the value of _CurrentProp which is an integer into the dialog. This is the dialog constructor and the load event inside that dialog..

[code]...

I am going to simply assign the value to a global variable inside the PropertySettings Class but everything I try seems to fail in one way or another...

View 1 Replies

Asp.net - Setting Control Text In Parent Form From Modal Popup

Mar 28, 2012

I have a problem I am trying to set the parent textbox from the modal popup.

Although I found the control from the modal popup with the below code
DirectCast(Parent.Page.Form.FindControl("ContentPlaceHolder1").FindControl("myAccordion").FindControl("txtTo"), TextBox).Text = str

This is being called on button click when the user has finished selecting from the Checkboxlist.

When the parent page is shown again though the textbox is empty.

The scenario of my user control is that a user is to select from a checkbox list which is a list of emails.

When done has been clicked then it is required that the selected emails be forwarded to the parent webpage.

Then the To Textbox in this case will be filled with the emails that the user has selected.

View 1 Replies

Minimizing A Modal Form Minimizes Parent Or Main Application?

Jun 2, 2009

Is it possible to have an application where form1 opens a second modal form (form2) and then allows the user to minimized form2 causing the entire application to minimize to the taskbar.(form2 is never shown in the taskbar) A simple example of this is winzip where a second modal progress window is opened which can be minimized?

View 10 Replies

Getting Parent Form's Property Values In A Child Form

Feb 20, 2012

I have a custom form that I use instead of msgbox for a number of reasons. The initial reason was to keep the message centered on it's parent rather than the screen. There are many articles about this but I still have not found an elegant way to get access to the Parent's properties from inside the Child without passing them in (by one way or another).

In the child form the me.parent, me.parentform are not instantiated and apparently can not be used.

The point is to have this form be totally encapsulated with the logic being self contained. This is not an MDI child, and I do not want it to be due to the limitations on MDI children.

My current workaround looks like this I use a ShowMsg Function in my MyMsgBox form which looks like this:

[Code]....

View 6 Replies

VS 2008 - Passing Data From WPF Parent To Child Form

Jan 27, 2010

In my WPF Form1 I have TextBlock1 that fill from AddressTableAdapter. To edit address user must click EditButton to open Form2 to perform changes. My problem is passing data to Form2 from Form1. In Form2 I have 3 TextBoxes Street, City, Zip, and StateComboBox. I try to code in Loaded procedure of Form2 like this and got error message:

Private Sub Form2Detail_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
Me.AddressTableAdapter.Fill(Me.AbcDataSet.Address)
Me.StreetTextBox = IIf(IsDBNull(AbcDataSet.Address.StreetColumn), "", AbcDataSet.Address.StreetColumn))
Me.StateComboBox = IIf(IsDBNull(AbcDataSet.Address.StateColumn), 0, AbcDataSet.Address.StateColumn))
End Sub

View 1 Replies

ASP.net Form Not Passing Ddl Values

Dec 9, 2011

I have a form with 2 dropdownlists and a submit button. I want to pass the values of the lists in a URL when the list is submitted but for some reason the initial value of the ddl is getting passed. Here's my code:

[Code]...

View 2 Replies

Passing Values From One Form To Another?

Jun 22, 2010

i have a listview control on form1. I want to send the selected value to form2.

I tried couple of ways but nothing seems to work correctly.

View 6 Replies

Close A Modal Form From Who Initiated Modal One?

Feb 25, 2011

I have a parent form (form1), which is calling a second form (form2) as modal.[code]...

No form2 is modal. Closing this form2 from the form itself is clear.But how can I close the form via myform2.close from form1 via an event handler?

View 6 Replies

Passing Values Within Repeater And Then To Another Form

May 2, 2011

I am trying to pass values within a repeater binding them to a button and pass them from this form to another form. When I compile this it gives me an error indicating.
System.FormatException: Input string was not in a correct format.

Button within Repeater Code in form1.aspx:
<asp:Button ID="Button1" runat="server" Text="" CommandName= "TEST" CommandArgument = '<%# Eval("Parking_ID") + "," + Eval("Parking_Name") %>' />

In form1.aspx.vb Repeater_ItemCommand Function:
Protected Sub repeater1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles repeater1.ItemCommand
If (e.CommandName = "TEST") Then
Dim commandArgsAccept As String() = e.CommandArgument.ToString().Split(New Char() {","c})
[Code] .....

View 1 Replies

Forms :: Passing Values Into Controls Of Other Form?

Sep 30, 2011

I have to ask a stupid question:How to pass values from my form into the controls of other form?I made textbox and button in my form1 and Label into the form2 When I click the button, I want to pass the values of the my textbox in the form1 into the labels of my form2

I am a student and totally new to vb.net

View 3 Replies

Passing Values Between Tabs In A Form In 2010?

Jan 1, 2012

I have a form with 3 tabs: one tab is for user entry and computations, a second tab shows values that will be used for computations which are read from one database (I call it settings in that the values are constants for calculations but it's not application settings in the way people think of it, to be clear) and the third displays a table from another database. The second tab has a table adapter interface for the dataset that contains values used for calculations that can be changed (to do different scenarios.) Those numbers are read from a single record in a database that has 20 fields and was read once when the data is loaded into the second tab to be displayed.

The problem I am having is that I would like to use the numbers from the second tab (the constants) in computations to be shown on the first tab. I have tried declaring the variables on the second tab as public but they are already "friends" with the form event. However, when I go to use them in calculations, it's like they don't exist.

For example, one calculation I am doing is fuel cost. The user enters miles and this is stored as a variable called mileage. To calculate the result fuelcost, I have to use two other fields that are shown in the second tab: MPG (miles per gallon) and fuelprice (the price of gas). So fuelcost = (mileage/mpg)*fuelprice. These are read from a datatable called testdata which is actually part of the project. I want to be able to use these variables throughout the program but declaring them as public isn't working.

How do I make the variables from one tab usable elsewhere in the program? The other thing I noticed is since the values of the variables are loaded into textboxes and assigned variable names by naming the textboxes, using val([variablename].text) isn't solving the problem either. For example, saying milespergallon = val(mpg.text) is not doing the trick because I am getting a message that 'text' is not an integer when I declare milespergallon.

Update Here the code that is being used:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mileage = Int32.Parse(Miles.Text)
Dim rate = 0
Dim baserate = 0

[code]....

TabPage2 is where the variables are displayed that I want to use in TabPage1.

Private Sub TabPage2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage2.Click
End Sub

View 2 Replies

Mdi Form And Show Form - Error "Form That Is Already Visible Cannot Be Displayed As A Modal Dialog Box"

Jan 26, 2010

I'm new in .Net and I have an application with windows form "LOGIN" When users enter the user and password and click "ok", then if user passes validation then I have the code Show(MDIMainMenu) (I'm trying to open an mdi form), but I receive the following error: "Form that is already visible cannot be displayed as a modal dialog box. Set the form's visible property to false before calling Show. Error Number 5"

[Code]...

View 2 Replies

VS 2005 Child Form Remain Enabled While Modal Form Displayed?

Oct 28, 2010

I have a VB. Net App where I want the user to open a modeless form which contains reference information about items in a select box. If the user double clicks the item selected in the list box a modal form is opened to edit the item.I want the previously opened reference form to remain active/enabled, that is, I want the user to be able to click on it, move it, etc.I was able to get the form to at least show up on the task bar by setting it's "ShowInTaskBar" property to true, however, when it comes to the front the user can still not move it to the side to view all of the Edit Forms information.

View 7 Replies

Calling Showdialog() On A Form - From The Main Form's OnLoad Event Makes The Modal Dialog Go Away After A Few Seconds?

Aug 7, 2009

I'm having an interesting issue that I can't reproduce on a different project, but can consistently on this one. I have no clue what might be causing it, but am hoping that someone may have seen it before.

I have a main form, from which I run a series of checks. On this form, I have a listview control. Because of some issues with the refreshing of this listview control, I had to create my own messagebox. It's just a form that displays some text ( it also happens to look nicer than MsgBox; in my opinion, anyways ). It's been working great for months, until recently.

My problem is that on my main form's load event, I run this check, which returns an error within a try/catch block. I then call my custom messagebox with a message. It in turns calls it's ShowDialog() function.

In any other situation ( after the main form has been loaded ), I have no problems. The messagebox goes on the screen and behaves appropriately ( ie: waits for my input and acts as a modal dialog ( stops execution of my main form's thread ) ). However, on this onload event, my messagebox comes up and goes away almost immediately afterwards.

I've traced it all the way to the showdialog() call. For no explicable reason, it appears to skip right over this call, without me doing anything on the form.

Here's what the inner trace looks like ( when I put a breakpoint on the onclosing event for this messagebox form ):

CODE:

View 10 Replies

Find When Dialog / Modal Form Is Shown For My Main Form?

Feb 3, 2010

I want to be able to check if there is currently a dialog or modal form shown for my form so that I can close it.
Is there a way to do this?

View 1 Replies

Keep Form On Top Of Another Form In Modal Fashion, But Continue Execution?

Apr 18, 2012

I have a form in a vb.net windows form application called PolicyRefreshStatus.vb that has a ProgressBar control on it. From the main form called EditPolicy.vb I need to show PolicyRefreshStatus.vb over top of EditPolicy.vb - but the way things are wired I'm controlling the the ProgressBar and it's steps from logic inside EditPolicy.vbIf I display the PolicyRefreshStatus.vb bar using the .show() method things work fine.The problem is if the user clicks back on the main form then PolicyRefreshStatus.vb losses focus. If I show PolicyRefreshStatus.vb as a modal form using .ShowDialog() then execution halts in EditPolicy.vb after the .ShowDialog() statement.

so for example in the code:
mPolicyRefreshStatus = New PolicyRefreshStatus
mPolicyRefreshStatus.pbMax = mPolicy.ClaimsUpdateMax

[code]....

View 2 Replies

Passing Data From Child To Parent Form Which Is A Child Of Another One

Apr 17, 2012

i have three forms

when i click button1 on form1=====> form2.showdialog()
then click button 1 on form2 =====> form3.showdialog
then click button 1 on form 3 =====>

[code].....

View 7 Replies

Have A Modal Form But Be Able To Access Another Already Open Form

Jul 20, 2010

I have designed my app for multiple gridviews. When a user double clicks a row it opens up the data in a modal form and when they commit changes the row gets updated.While they have that modal window open they can not go back to the grid.But I have a alerts/messages window always running (like outlook tasks). As soon as I open the modal window I can not access that tasks window. (Default behaviour)How can I open the modal form and still let the user access/view the tasks window while they work on the modal window.(I tried creating it in a differant thread, but got a lot of cross thread errors so decided to abandon that approach.I thought that 2 modal form can run at the same time as long as they have differant parents. But aparently the main GUI thread pauses as soon as you open a modal window on it.

View 10 Replies

2003 Control On Child Form To Create Event On Parent Form?

Oct 28, 2010

Here is the pertinent part of my code:

Public Class Form1
Inherits System.Windows.Forms.Form
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

[code].....

View 3 Replies

Change Startup Position And Move A Docked Form With Parent Form?

Mar 23, 2011

well i successfully docked a perpixel alpha form with the main form(form1). but the perpixel alpha form always appears at the top left corner of the screen and when i move the main form the form(perpixel alpha form) inside it dosen't move it stays at the top left corner. ALWAYS. to dock the perpixel alpha form i used

Me.toplevel = false
Me.parent = form1

View 6 Replies

VS 2010 Sub/Child Form Close When Click On Main/Parent Form?

Jun 5, 2012

i am having some trouble in my Windows form application. i have 2 forms1st Main / Parent Form2nd Sub / Child Form (Menu)

View 7 Replies

Write Text From A Parent Form To The Active Mdi Child Form VB 2010

Jan 28, 2012

It has to be a simple line of code but I do not know how to construct it. Using VB 2010 Express, I have a MDI parent form and many child forms. I want the parent form to determine what child form is active and load data into the RichTextBox1 on the child form. Each Child form has a RichTextBox1. The parent form gets its data by loading a file.

I am close to a solution but just can't get there. You will see in the code below, if I make a direct reference to a specific child form, it works great. What I want to do is to use the Active Form function to determine which form to write to. I have looked at the MS tutorial which gets me close.

Private
Sub OpenToolStripMenuItem_Click(ByVal sender
As System.Object,

[Code].....

View 6 Replies

Call A Form Load Parent Event From A Child Form?

Jun 3, 2011

I have two forms. Form A and Form B. Form A has a datagrid that is populated from a SQL Database Table query. When a button is pressed Form B is launched that allows you to add a record to the database table. I need for the datagrid to be refreshed and show the newly added record when I close form B and go back to the parent.

[Code]...

View 2 Replies

Create New Instance Of A Form That Does Not Close Then The Parent Form Closes?

Oct 28, 2009

I have been making a webbrowser for a while now, everything works well, except i am unable to make the 'open in a new window' button work right. So far i have managed to get a new instance of my form to open with the right url, but i am unable to keep that new form open when the orginal parent form closes.

Code:

Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow
e.Cancel = True
Dim Href As String

[code]....

View 2 Replies

DB/Reporting :: PopUP Form Refresh Combobox On Parent Form

May 31, 2008

I have a parent form that has a combobox. Whn the form loads I get the data from the db and bind to the combobox. that works fine and here is the code I use in form load to cause this to happen: [code] Now if there is not an Account Type, I have a button that will pull up a small form to allow the addition of an account type. The popup form adds the data back to the database just fine, but I am now trying to get the combobox to refresh its data. So I call a public Sub that is located in the parent form to from the popup form to accomplish this task and I have walked the code and the sub is called and appears to work correctly, but the new data never appears in the combobox. Here is my public sub that i call to try and refresh the combobox on the parent form. [code] But when I go back to the parent form, the combobox is not updated with the new account. How can i get the combobox to refresh from the database with the new data?

View 4 Replies

Open A MDI Child Form Using A MenuList On The Main MDI Parent Form?

Feb 6, 2011

I have a MDI Parent form created with a MenuList, I also have the MDI child form created.ow do I go about using the MenuList to open the MDI child form within the parent form?

View 1 Replies

Refreshing DataGrid On Parent Form After A Child Form Has Updated DB?

Dec 3, 2009

Basically I have two forms - Form1 has a DataGrid on it (Infragistics) and in the double-click row event it creates an instance of the EditForm and passes along the UniqueId for editing. Once the user saves the changes (if they make changes) - I want the DataGrid on Form1 to refresh. Here is how I thought I could get this to work ... I create a public property called RefreshRequired as boolean. Before unloading the EditForm it sets this property to true. Then Unloads. This continues the code in Form1 (which showed the EditForm as modal) but RefreshRequired is still showing as False? Why isn't my EditForm able to set the property?

FORM 1
Private Sub grdList_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdList.DoubleClick
' TODO Ignore Double-Click Event when Right Mouse Button Triggers Event

[code]....

View 1 Replies

Stop All The Functions On Parent Form While Child Form Is Still On Screen?

May 1, 2009

form1 has datagridview, when I click "add new", form2 appears(details view, allowing me to add new records into datagridview on form1). when I click "add new" again, form2 appears again, if I click x times, form2 will appear x times. How do I stop the add new button and all the functions on form1 from working until form2 is closed?

View 6 Replies

Update Open Child Mdi Form Textbox From Parent Form?

Feb 3, 2012

I have a date selector on mdi parent that updates a property when date is changed. When I open a child form, it grabs the property just fine. However if I change the date again after the child is open the date does not change on the child unless I close and reopen the form as expected. What would be the best way to automatically update all open child forms when the date is changed on the parent at anytime? running a timer to parse the date property is impractical.

View 2 Replies







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