We help IT Professionals succeed at work.
Get Started

vb.net custom message box as class library

PeterBaileyUk
on
610 Views
Last Modified: 2017-06-05
I made some custom buttons last week and can add them to my projects as I need by adding the dll. I would like to create a custom message box with three buttons on it of which I can alter the text in much the same way.

the same as a yesnocancel messagebox but with me deciding the text on the buttons.

in this example the choice will be Export to SQL, Export To Access, Export to both

not sure how to do that. I looked to try to inherit the messagebox but couldnt see that either. not sure where to start I have created a form by adding it and putting on 3 buttons but that doesnt seem enough

ive started with this not sure if its right direction
Imports System.Drawing
Imports System.Windows.Forms
Public Class Class1
    Dim CwMsgBox As New Form

    Public Sub New()

        Dim BtnSQL As New Button
        Dim BtnLegacy As New Button
        Dim BtnBoth As New Button

        BtnBoth.Text = "Export To SQL and Legacy Access DB's"
        BtnSQL.Text = "Export To SQL Server DB's"
        BtnLegacy.Text = "Export To Legacy Acess DB's"
        BtnBoth.Location = New Point(279, 45)
        BtnLegacy.Location = New Point(29, 45)
        BtnSQL.Location = New Point(152, 45)

        CwMsgBox.Size = New System.Drawing.Size(400, 200)
        CwMsgBox.Location = New System.Drawing.Point(0, 0)
        CwMsgBox.Controls.Add(BtnSQL)
        CwMsgBox.Controls.Add(BtnLegacy)
        CwMsgBox.Controls.Add(BtnBoth)



    End Sub

    Private Sub BtnSQL_Click(sender As Object, e As EventArgs) Handles BtnSQL.Click

    End Sub

    Private Sub BtnBoth_Click(sender As Object, e As EventArgs) Handles BtnBoth.Click

    End Sub
    Private Sub BtnLegacy_Click(sender As Object, e As EventArgs) Handles BtnLegacy.Click

    End Sub

End Class

Open in new window

Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE