Re: Beginner Dialog Question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On 6 nov, 09:57, markl...@xxxxxxxxx wrote:
I have a dialog box that asks for user input in 3 textboxes and has 2
buttons: Ok & Cancel.

If the user input is validated, the box should return
DialogResult.OK. If the user input isn't validated, it should display
a message and return nothing at all, keeping the dialog box visible
until the input is validated or the user presses the cancel button.

The problem is that I can't choose between "return DialogResult.OK" or
just "return" (to keep the dialog visible) because they're different
return types.

I can think of a few ways to work around it, including validating the
input in the main form and re-displaying the dialog box if it fails,
but I'm wondering what the standard method of handling something like
this?

In my experience, everyone has something to complain about for all
dialogs.

But in general, dialogs within an application should all behave the
same way.

My recommendation is to 1) choose the behaviour that fits in with the
rest of the dialogs in the application and then 2) get user feedback
from a prototype and update the behaviour accordingly.

.



Relevant Pages

  • install SP4 failure
    ... Service Pack started with following command line: ... AnalyzePhaseZero used 0 ticks ... User Input: CANCEL ... Are you sure you want to cancel? ...
    (microsoft.public.win2000.setup_upgrade)
  • Re: Healing mod tips?
    ... the UI function to cancel a spell cast requires user input (just like ... Any idea what qualifies as "user input"? ... movement keys; I'm assuming that that will still work...? ...
    (alt.games.warcraft)
  • Re: Waiting for an event
    ... user input into the dialog to continue your processing? ... it sounds as though you want to show the AddressPrompt() ... Set the Cancel Button's DialogResult to cancel. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Modeless do not accept cancel until the end
    ... Rui Oliveira wrote: ... a cancel button to stop progress of the task. ... The problem is that dialog does not accept any click in cancel button until the end of task. ... While your code is doing the long task your code is not checking for user input. ...
    (microsoft.public.vc.mfc)
  • Re: How to turnoff the Halt mess in a macro when running a qby cancel
    ... You either need to train the user not to click the Cancel button, or else use a textbox on a form to gather the criteria information, instead of a parameter query. ... Steve Schapel, Microsoft Access MVP ... for user input example, which brings up a dialog box for input with enter and cancel buttons. ...
    (microsoft.public.access.macros)