Incredible minimizing form!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DragonLord
    New Member
    • Mar 2007
    • 122

    Incredible minimizing form!

    Ok I have a unique situation I haven't encountered before.

    From my main form when a keypress event is triggered (enter key) it calls another form that allows the user to enter a quantity and then assigns that quantity to a variable in my main form.

    Works great only if i trigger the even more than once the second time i press enter and the second form is closed my main form is minimized to my task bar.... really annoying. Anyone know how i can resolve this, i tride refreshing the main form upon retrun to the calling proceadure but it still happens frequently.

    Thanks in advance.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by DragonLord
    Ok I have a unique situation I haven't encountered before.

    From my main form when a keypress event is triggered (enter key) it calls another form that allows the user to enter a quantity and then assigns that quantity to a variable in my main form.

    Works great only if i trigger the even more than once the second time i press enter and the second form is closed my main form is minimized to my task bar.... really annoying. Anyone know how i can resolve this, i tride refreshing the main form upon retrun to the calling proceadure but it still happens frequently.

    Thanks in advance.
    Perhaps if you post the code that you used ...

    Comment

    • DragonLord
      New Member
      • Mar 2007
      • 122

      #3
      Code:
       
      private void textBoxInvoiceNumber_KeyPress(object sender, KeyPressEventArgs e)
      		{
      			if (checkBoxMultiScan.Checked == false)
      			{
      				if (e.KeyChar == (char)Keys.Enter)
      				{
      					//Find out how many items are to be entered
      					int intScanQuantity;
      					intScanQuantity = GetQuantity();
      					ScanItems(intScanQuantity,textBoxInvoiceNumber.Text,textBoxAddress1.Text);
      					this.Refresh();
      				}
      			}
      		}
       
       
        private int GetQuantity()
      		{
      			FormResults fr = new FormResults();
      			fr.ShowDialog();
      			return Convert.ToInt32(fr.getQuantity);
      		}

      Comment

      • DragonLord
        New Member
        • Mar 2007
        • 122

        #4
        Any thoughts ?One thing i should mention is i am debugging maybe that makes a difference?

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by DragonLord
          Any thoughts ?One thing i should mention is i am debugging maybe that makes a difference?
          Shouldn't you be destroying that fr object once you get the input you need? Why not use a simple input dialog instead?

          Comment

          Working...