Author Topic: method blows right past form  (Read 1364 times)

0 Members and 1 Guest are viewing this topic.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
method blows right past form
« on: November 02, 2011, 04:58:01 PM »
Maybe I'm just doing it wrong, (probably) but when my method calls my form, it keeps right on going without waiting for the results. What am i doing wrong?
Code: [Select]
BusSupport bsForm = new BusSupport();
bsForm.Show();
string bsAttach = bsForm.BusSupportAttachment;

Database db = HostApplicationServices.WorkingDatabase;
....
this is where I called the form, and this is the form prop.
Code: [Select]
public string BusSupportAttachment
{
get {
return cboBusAttachment.SelectedText;
}
}
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Bryco

  • Water Moccasin
  • Posts: 1883
Re: method blows right past form
« Reply #1 on: November 02, 2011, 06:45:25 PM »
did you want form.ShowDialog();

Jeff H

  • Needs a day job
  • Posts: 6150
Re: method blows right past form
« Reply #2 on: November 02, 2011, 06:49:42 PM »
Application.ShowModelessDialog()
or
Application.ShowModalDialog()
 

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: method blows right past form
« Reply #3 on: November 03, 2011, 09:46:29 AM »
Those would make the program wait?  I will have to try that.
 
Once again you guys RULE!!!  Man I have been gone from this for too long.  I have forgotten everything.
« Last Edit: November 03, 2011, 09:53:35 AM by CmdrDuh »
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: method blows right past form
« Reply #4 on: November 03, 2011, 09:51:55 AM »
The ShowDialog pauses the current function and passes control to the form. When the dialog closes, control is passed back to the originating function. Show merely shows the dialog.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie