• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 170
  • Last Modified:

Own Dialog Box

Hi All,

I would like to make my own "dialog box".

What I would like to have is something that is similar to the Common Dialog, but not working with files etc, it will be working with say for instance a list of people.

I would like to be able to call this form/dialog from anywhere in my app and return a name of a person from the list on that form.

something along the lines of:

'//
f_GetName()

frmNamePopup.Show
f_GetName = frmNamePopup.txtName.text
'//

I know that the above idea wont work!!! Its just a thought.

0
nzfire
Asked:
nzfire
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
frmNamePopup has a TextBox (Text1) and a CommandButton (Command1):

' --------------------
' Form1
' --------------------
Private Sub Command1_Click()
    Dim result As String
    result = frmNamePopup.ShowDialog
    Label1.Caption = result
End Sub


' --------------------
' frmNamePopup
' --------------------
Public Function ShowDialog() As String
    frmNamePopup.Show vbModal
    ShowDialog = frmNamePopup.Text1.Text
End Function

Private Sub Command1_Click()
    Me.Hide
End Sub
0
 
nzfireAuthor Commented:
perfect!! Thanks Idle_Mind...I'll have to bear you in mind while I work on this project with a deadline!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now