Avatar of PeterBaileyUk
PeterBaileyUk

asked on 

vb.net custom message box as class library

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

Visual Basic.NET

Avatar of undefined
Last Comment
Robberbaron (robr)

8/22/2022 - Mon