Page 1 of 1

Custom Message Box's

Posted: Thu May 12, 2011 10:33 am
by Mark
Hey Guys,

Can anyone make a tutorial on how to make a cutom message box please?.

Re: Custom Message Box's

Posted: Thu May 12, 2011 12:25 pm
by Agust1337
Making a form as a dialog is simple:
Code: Select all
frmMessageBox.ShowDialog(me)

Re: Custom Message Box's

Posted: Thu May 12, 2011 12:26 pm
by mandai
If you want to design the form you would do it this way:

Right click the solution explorer, choose Add and select Windows Form.
Add a couple of buttons to this new form and set their DialogResult properties.

Next call Form2.ShowDialog(), you can see which button was clicked by the value this returns.

Re: Custom Message Box's

Posted: Thu May 12, 2011 12:52 pm
by Mark
How do i set there dialog properties anychance of a small tutorial please

Re: Custom Message Box's

Posted: Thu May 12, 2011 1:40 pm
by Agust1337
Which dialog properties?

Re: Custom Message Box's

Posted: Thu May 12, 2011 1:48 pm
by Mark
I mean a custom error, information, etc boxes.

Re: Custom Message Box's

Posted: Thu May 12, 2011 1:54 pm
by Agust1337
You can use images for that on your form(s)

edit:
also if you have some statement that uses try you can do this:
Code: Select all
Try
'some code
Catch ex As Exception
frmMessageBox.Label1.Text = ex.Message
frmMessageBox.ShowDialog(me)
End Try

Re: Custom Message Box's

Posted: Thu May 12, 2011 1:59 pm
by Codex
I think he wants to make this into a DLL, and therefore he needs to add properties.
You would need to do it some thing like this:
Code: Select all
Dim mbimage as image
   Public Property Image() As Image

      ' get image from mbimage
      Get
         Return mbimage
      End Get

      ' set image from value entered
      Set(ByVal value As image)
         mbimage = value
      End Set

   End Property

Re: Custom Message Box's

Posted: Thu May 12, 2011 4:12 pm
by Skillful