Make a DLL in Visual Basic 2008 Express Edition

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
31 posts Page 3 of 4
User avatar
astheyfall
VIP - Donator
VIP - Donator
Posts: 160
Joined: Sun Sep 19, 2010 6:13 am

So, Can you use a DLL in visual basic like drag and drop it in the toolbar?

and if you can, can you make it to where it would be a button that displays a message box? (Example)
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

yes it would be easy

-make a new project
-make a new class
-under the first line (Class class1 or something), put
Code: Select all
Inherits Button
-go to button_click event of your class
-put the code you want(msgbox)
http://vagex.com/?ref=25000
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

OR you can do this:
Code: Select all
Public Class btn
    Inherits Button

    Public Sub New()
        Me.Size = New Size(123, 89)
    End Sub

    Protected Overrides Sub OnMouseClick(ByVal e As System.Windows.Forms.MouseEventArgs)
        MyBase.OnMouseClick(e)
        MsgBox("Clicked!")
    End Sub
End Class
Top-notch casual Dating
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Agust1337 wrote:
OR you can do this:
Code: Select all
Public Class btn
    Inherits Button

    Public Sub New()
        Me.Size = New Size(123, 89)
    End Sub

    Protected Overrides Sub OnMouseClick(ByVal e As System.Windows.Forms.MouseEventArgs)
        MyBase.OnMouseClick(e)
        MsgBox("Clicked!")
    End Sub
End Class
thats what I explained
http://vagex.com/?ref=25000
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Making it simple for him if he didn't understand
Top-notch casual Dating
User avatar
Napster1488
VIP - Donator
VIP - Donator
Posts: 524
Joined: Fri Jan 07, 2011 8:41 pm

Someone here knows how i can Add a Event in a DLL like this
i wonna call it (IsPlaying) and i wonna use it like this
If DLL.IsPlaying = True then
something here...
End If

???!
How to do such Event ?!
YouTube Downloader v3.0
Image
Image
Image
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

I hate events they require too much work(in VB that may be easier but in C# its damn hard)
http://vagex.com/?ref=25000
User avatar
Napster1488
VIP - Donator
VIP - Donator
Posts: 524
Joined: Fri Jan 07, 2011 8:41 pm

I wonna have it in VB.NET Language
YouTube Downloader v3.0
Image
Image
Image
User avatar
anthonygz
Member
Member
Posts: 48
Joined: Sun Feb 13, 2011 7:25 pm

very nice!
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Events are simple to use in both VB.Net and C#.
In VB.Net you could do it this way:
Code: Select all
    Event event_test(ByVal test As String)

    Sub test(ByVal input As String)
        MsgBox(input)
    End Sub

    Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click

        AddHandler event_test, AddressOf test
        'Note: you may add as many handlers as you want.

    End Sub

    Private Sub btnRaise_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRaise.Click

        RaiseEvent event_test("testing")

    End Sub
31 posts Page 3 of 4
Return to “Tutorials”