Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7762451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:24:23+00:00 2026-06-01T14:24:23+00:00

I have a very basic question. Scenario: 2 forms Form1, Form2- Dialog box which

  • 0

I have a very basic question.
Scenario: 2 forms Form1, Form2- Dialog box which takes 3 inputs from the user
Form1 has a grid in which the user can select some cells.
Once the user makes a selection , the rowindex and colindex are stored in variable c1,c1,r1,r2

Form1:

private InsertRowsMethod(...)
{
float dv ;
     GridRangeInfoList list;
       Boolean b = theGrid.Selections.GetSelectedRanges(out list, true);
       if (list.Count > 0)
       {

          r1= list.ActiveRange.Top;  
          c1 = list.ActiveRange.Left;
          c2 = list.ActiveRange.Right;
       }
     DateTime dt;
    frmDialog dialog = new frmDialog();

    dialog.Show();

     int dialognrows = Int32.Parse(dialog.textBox1.Text);
    float dialogdv = float.Parse(dialog.textBox2.Text);
   // var dttext = (DateTime.Parse(textBox3.Text)).Ticks;

    TimeSpan dialogdt = TimeSpan.Parse(dialog.textBox3.Text);


    for (int nc = insertc1; nc <= insertc2; nc++)
    {
        insertData(nc, insertr1, dialognrows, dialogdv, dialogdt, null);

    }


}

In Form2:
It takes 3 parameters. nrows,time,value
Now I need to pass these 3 variables from Form2-Dialog to Form1.
I tried the Brute force way(which I would like to change, which I will come to it later)

In form2: I created method

     private void button1_Click(object sender, EventArgs e)
            {
                int nrows = Int32.Parse(textBox1.Text);
                float dv = float.Parse(textBox2.Text);
               // var dttext = (DateTime.Parse(textBox3.Text)).Ticks;

                TimeSpan dt = TimeSpan.Parse(textBox3.Text);
                this.Hide();



}

So it worked, I was able to pass the three parameters nrows, dv, dt(user inputs) from dialog to form1-main form.

Question: I want the program in Form1 to wait,show the dialog, take user inputs and come back and continue to do this part.

     for (int nc = insertc1; nc <= insertc2; nc++)
                    {
                    insertData(nc, insertr1, dialognrows, dialogdv, dialogdt, null);

                    }}

The dialog should show and then back to form1 to execute the insertdata

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:24:25+00:00Added an answer on June 1, 2026 at 2:24 pm

    So Form2 is supposed to be a pop-up?

    In that case when you create it, open it with

    MyForm2.ShowDialog();
    

    This will make the dialog box “modal”, which means that the user won’t be able to interact with the first form until they have dealt with this new form. Then if you have public properties in form 2 you should be able to access them in form 1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very basic syntax question on Populating a dropdownlist box from dataset.
I have a very basic question in saving objects which I get from a
I have a very basic question about calculating RMSE in an NB classification scenario.
I have a very basic question. Lets take this snippet: #include <stdio.h> void foo(void)
A very basic question in excel. I have a column with valid and with
Very basic question - but I couldn't find an answer. I have got a
This is a very basic question...quite embarassing, but here goes: I have a Stopwatch
quick and very basic newbie question. If i have list of dictionaries looking like
Probably a very basic beginner question. Imagine the following situation: I have an ASP.NET
I am student of RDBMS. I have very basic question let say I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.