Results 1 to 2 of 2

Thread: Basic taskdialog follow on...

  1. #1
    Member
    Join Date
    2011-01
    Posts
    6
    Login to Give a bone
    0

    Default Basic taskdialog follow on...

    Code:
                 else
                {
                    TaskDialog var_WSNotEnabled_dialog = new TaskDialog("Workshare Enabler");
                    var_WSNotEnabled_dialog.MainContent = "Your project is not currently workshared, this process will:"+"\n"+
                    "- Turn on worksharing."+"\n"+
                    "\n"+
                    "Are you sure you wish to proceed?";
                    var_WSNotEnabled_dialog.TitleAutoPrefix = false;
                    var_WSNotEnabled_dialog.AllowCancellation = false;
                    var_WSNotEnabled_dialog.CommonButtons = TaskDialogCommonButtons.Yes | TaskDialogCommonButtons.No;
                    var_WSNotEnabled_dialog.DefaultButton = TaskDialogResult.No;
                    TaskDialogResult var_WSNotEnabled_Result = var_WSNotEnabled_dialog.Show();
                    
                    if(var_WSNotEnabled_dialog.Show() == TaskDialogResult.Yes)
                    {
                        //TaskDialog.Show("This is a placeholder", "Yes! :)");
                        TaskDialog var_ExitDialog = new TaskDialog("H&E Workshare Enabler");    
                        var_ExitDialog.MainContent = "Yes, all that coding time isn't going to waste.";
                        var_ExitDialog.TitleAutoPrefix = false;
                        var_ExitDialog.AllowCancellation = false;
                        //var_ExitDialog.CommonButtons = TaskDialogCommonButtons.Close;
                    }
                    else //if (var_WSNotEnabled_Result == TaskDialogResult.No)
                    {
                        //TaskDialog.Show("This is a placeholder", "No! :(");
                        TaskDialog var_ExitDialog = new TaskDialog("H&E Workshare Enabler");
                        var_ExitDialog.MainContent = "All that coding time wasted.";
                        var_ExitDialog.TitleAutoPrefix = false;
                        var_ExitDialog.AllowCancellation = false;
                        var_ExitDialog.CommonButtons = TaskDialogCommonButtons.Close;
                        return;
                    }
                }
    This is the second part of an if check. Does something if the document is already workshared, otherwise, it steps to the first else in the code above. At that point we run another check - do they want to proceed. Right now I'm flowing to two placeholder dialog boxes. Users clicks yes, dialog 1. No, dialog 2.

    The issue: Can someone explain why the second dialog shows if I use the static (commented out above) form, but not the instance? It's driving me bloody crazy...

  2. #2
    Active Member
    Join Date
    2008-03
    Posts
    55
    Login to Give a bone
    0

    Default Re: Basic taskdialog follow on...

    Hi Scatter,

    You haven't marked this as solved so...

    1. The first if statement should be comparing "var_WSNotEnabled.Result"
    2. You've created instances of the other two dialog boxes...but you never "Show" them.

    Hope this helps,
    Eddy

Similar Threads

  1. 2015: UCS will not follow view
    By lynx_20 in forum AutoCAD 3D (2007 and above)
    Replies: 4
    Last Post: 2016-02-04, 03:40 AM
  2. can you create plans in revit? basic basic
    By comical_wenger in forum Revit Architecture - General
    Replies: 5
    Last Post: 2009-06-22, 01:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •