Results 1 to 4 of 4

Thread: I hate it so much!

  1. #1

    Thread Starter
    Hyperactive Member vbzero's Avatar
    Join Date
    Aug 2000
    Location
    Vienna
    Posts
    347

    Question I hate it so much!

    If anyone is able to do that, please reply:

    1. Create a new form in your project and set it as the
    startup form.

    2. Add a second form that can be used as dialog.

    3. Add a button to the dialog form and then do the following:

    When the application starts, the startup form should
    call the dialog form to be shown on the screen.
    During this, the startup form has to be disabled for a while.

    The second form has a button and if you click it, it should
    enable the first form and close the dialog.

    Can anybody do that in VB.NET?

    thx!

  2. #2
    Hyperactive Member Scott Penner's Avatar
    Join Date
    Dec 2000
    Location
    Mountain View
    Posts
    327
    I answered this in the C# forum
    link to thread
    -scott
    he he he

  3. #3

    Thread Starter
    Hyperactive Member vbzero's Avatar
    Join Date
    Aug 2000
    Location
    Vienna
    Posts
    347
    Please try to do this in .NET and give me the code...

    thx!
    Attached Files Attached Files

  4. #4
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    documentation is good

    Form.Modal...?

    When a form is displayed modally, no input (keyboard or mouse click) can occur except to objects on the modal form. The program must hide or close a modal form (usually in response to some user action) before input to another form can occur. Forms that are displayed modally are typically used as dialog boxes in an application.

    You can use this property to determine whether a form that you have obtained from a method or property has been displayed modally.

    To display a form modally use the ShowDialog method

    Example
    The following example displays a form as a modal dialog box and reads the result of the dialog box before determining whether to read the value of a TextBox control on the dialog box form. This example assumes that a Form named Form2 is created and that it contains a TextBox control named TextBox1. The example uses the version of ShowDialog that specifies an owner for the dialog box.

    Note This example shows how to use one of the overloaded versions of ShowDialog. For other examples that might be available, see the individual overload topics.

    Code:
    Public Sub ShowMyDialogBox()
        Dim testDialog As New Form2()
        
        ' Show testDialog as a modal dialog and determine if DialogResult = OK.
        If testDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK Then
            ' Read the contents of testDialog's TextBox.
            result.Text = testDialog.TextBox1.Text
        Else
            result.Text = "Cancelled"
        End If
        testDialog.Dispose()
    End Sub 'ShowMyDialogBox
    Magiaus

    If I helped give me some points.

Posting Permissions

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



Click Here to Expand Forum to Full Width