Results 1 to 8 of 8

Thread: Show and ShowDialog

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2004
    Posts
    235

    Show and ShowDialog

    Why is it that I cant use ShowDialog()

    Use of unsupported member 'valuetype System.Windows.Forms.DialogResult System.Windows.Forms.Form::ShowDialog()'

    If DatePicker1.Value >= DateTime.Today Then
    cf2.TextBox1.Text = CStr(DatePicker1.Value)
    'cf2.Refresh()
    cf2.ShowDialog()
    Me.Hide()
    End If

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Can you explain a little more about your problem !

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2004
    Posts
    235
    meaning...
    i got this cf2 which i Dim cf2 as new form2

    but when I try to use cf2.showdialog(), it give me the error stated as above...

    but when I try to use cf2.show(), it works perfectly well, so I'm wondering what is going on....

  4. #4
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461
    I've not understood where exactly that error occurs. Debugger has very strange habits when is managing modal form. Often it point to 'ShowDialog' line also when the problem is in the code of the form (cf2). So, you have to follow, step by step, your code and discover where error really occurs, then it will be easier to solve it...I hope!
    Live long and prosper (Mr. Spock)

  5. #5
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    The problem is NOT in your posted code. That works perfectly for me, with both Show() and ShowDialog().

    Use breakpoints in your code to pinpoint the actual location of the error.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jul 2004
    Posts
    235
    Because the error says .ShowDialog() unsupported type of member

  7. #7
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461
    Just a doubt: Have you this error at runtime, or during compilation?
    Then...how you declare your 'cf2'.
    I'm not sure to be able to help you, but.....!
    Live long and prosper (Mr. Spock)

  8. #8
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949
    Hi,

    Have you messed arround with the event handler in the cf2's closing event?

    If that is OK I suggest you reinstall VB.NET.
    Taxes
    The more I learn about VB.NET the more I like dBaseIII Plus

    The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.

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