Results 1 to 3 of 3

Thread: return string from dialog box

  1. #1

    Thread Starter
    Fanatic Member venerable bede's Avatar
    Join Date
    Sep 2002
    Location
    The mystic land of Geordies
    Posts
    1,018

    return string from dialog box

    I know this is silly but I can't figure out how to do this in a tidy fashion.

    If the dialog result is OK then I want to get a string from my dialogbox.

    Any ideas


    TIA

    Parksie

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: return string from dialog box

    I would create a public property within the form itself. Then you can access the value through the property.

    So (Pseudo code since I don't have VS in front of me)

    If (MyDialog.ShowDialog() = DialogResult.OK) Then
    MessageBox.Show(MyDialog.TextProperty)
    End If
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: return string from dialog box

    How do you normally get a string from an object? You get a property value or call a method and get the return value. So... how do you get a string from your form, bearing in mind that a form is an object?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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