VB.NET Tutorial - Create a DLL / Class Library (Visual Basic .NET)

Поділитися
Вставка
  • Опубліковано 16 лип 2024
  • In this Visual Basic .NET tutorial I will be showing you how to create and use your own DLL (Dynamic Link Library) in your VB.NET projects.
    We will create a DLL file for managing form graphics and use that DLL to draw images to forms and form controls.
    TUTORIAL FEATURES:
    DLL - Library, Namespace, Class
    Graphics - System.Drawing, Image
    Form Controls - Button, PictureBox
    Class - Image Manager

КОМЕНТАРІ • 55

  • @meisamrasouli4269
    @meisamrasouli4269 2 роки тому +2

    Thank you for this nice and basic tutorial on Visual Basic.NET dll files.

  • @mykeruiz2129
    @mykeruiz2129 7 років тому +3

    This is a very interesting tutorial. It helps a lot for a beginner like me. Thank you for uploading tutorials like this.

  • @henryphan9922
    @henryphan9922 4 роки тому +1

    Beautiful tutorial. It helps me understand a lot about DLL. Thanks.

  • @davemagnusson8514
    @davemagnusson8514 Рік тому +1

    Well Done

  • @aequabit
    @aequabit 8 років тому +1

    Totally love you, apart from the coding stuff. Keep it up, you're one of the rare, good guys on UA-cam.

    • @VBToolbox
      @VBToolbox  8 років тому

      Thank you! I really appreciate that. :-D

  • @yassine4201
    @yassine4201 8 років тому +1

    thanks.. it's very helpful :)

  • @walkcomp
    @walkcomp 10 років тому

    Nicely done Thanks

  • @lloydshort7948
    @lloydshort7948 7 років тому

    excellent presentation

  • @perryhoofd
    @perryhoofd 9 років тому

    Thanks :D

  • @abomoh4602
    @abomoh4602 Рік тому

    thank you🧿

  • @lywatanak8594
    @lywatanak8594 8 років тому +1

    This is the best project for me thz VB Toolbox

    • @VBToolbox
      @VBToolbox  8 років тому +1

      +Ly Watanak I'm very happy that it was helpful! :-)

  • @hectorsantini344
    @hectorsantini344 5 років тому

    I'm a newbie and would like to know if you have an example using the windows OpenFile Dialog to be able to choose any image from the directory. This have been a very interesting tutorial especially for a beginner like me. Thanks.

  • @Fehera85
    @Fehera85 9 років тому +1

    31:33 LOOOL Where is that came from? I love your tuts!! No1 on my list

  • @sachinmalla
    @sachinmalla 10 років тому

    What we have to do for importing xls, csv and xlsx file
    thank you

  • @josephwarner9148
    @josephwarner9148 3 роки тому

    Very nice tutorial. Can you organize the functions in modules to keep the length of the DLL manageable? I am thinking of something like having each class being a module. Like have a class of constants, a class of orbit parameters, and a class of antenna parameter functions, and class of plots. It would look better I think if all the functions for one class was in its own module. Otherwise I see a dll being thousand of lines long.

  • @ArjolP
    @ArjolP 9 років тому +1

    C# and Java got a lot of similarities :O
    At least in the coding language.

  • @devindwight4564
    @devindwight4564 10 років тому

    I made a .dll file with an XNA base. So all I would need to do is move that ".dll" file into any project that I could use those same boilerplate classes?

  • @graphexx103
    @graphexx103 7 років тому

    how or where i could find or create the comwrap.dll and toolkitpro1201vc90.dll file missing from my computer

  • @vishayinternet
    @vishayinternet 7 років тому

    Hello, how can i create Activex control in VB.net (VS2010). I just want to create simple speedometer in VB.net

  • @iordanchis2437
    @iordanchis2437 7 років тому +1

    First o all great job! I hope you're still making videos like this. You're doing humanity a great service! Thank you sir! :D
    The Image in the PictureBox doesn't load a second time after I've loaded and then deleted it once. Why is that? Shouldn't it appear/reappear and disappear every time i click on the Draw and Delete buttons? If not, how do I make it work like that? Thanks!

    • @mohdroslikhairi6162
      @mohdroslikhairi6162 4 роки тому +1

      Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
      PictureBox1.Image = Nothing
      PictureBox1.BackColor = Color.Empty
      PictureBox1.Invalidate()
      End Sub
      Works for me

  • @sushobhansardar6426
    @sushobhansardar6426 5 років тому

    5:00 Reference is not being added to it. So I'm unable to do System. Drawing < please assist.>

  • @HazardEdit
    @HazardEdit 9 років тому +1

    might be a stupid question, however... is it possible to export a dll from visual basic and use it in c#? since both languages are .NET?
    for example i like the easy md5 function from visual basic and want to use it in c#.

    • @robinroos2254
      @robinroos2254 8 років тому +1

      Yes but dont ask me how

    • @HazardEdit
      @HazardEdit 8 років тому +1

      I already forgot I asked this. well I published a dll for hashing encrypting etc written in c# and it can be used in both f# and vb aswell. :) But thanks for responding

  • @shabeershah2002
    @shabeershah2002 8 років тому +1

    i loved this!!!!!!!!!!!!!, super buddy, keep uploading.

    • @VBToolbox
      @VBToolbox  8 років тому

      +shabeer shah I'm glad you liked it! Thank you much for the feedback. :-D

    • @georgegallimore6690
      @georgegallimore6690 8 років тому

      +VB Toolbox mine is not working here's my code: class 1
      Imports System.Drawing
      Namespace GDI
      Public Class IMmanager
      Public images As New Dictionary(Of String, Image)
      Public Sub loadImage(name As String, path As String)
      If images.ContainsKey(name) Then
      Exit Sub
      Else
      Try
      Dim i As Image = Image.FromFile(path)
      images.Add(name, i)
      Catch ex As Exception
      End Try
      End If
      End Sub
      Public Sub removeImage(name As String)
      If images.ContainsKey(name) Then images.Remove(name)
      End Sub
      Public Sub drawImage(surface As Object, name As String, position As Point, Optional size As Point = Nothing)
      Try
      If images.ContainsKey(name) Then
      Dim G As Graphics = surface.creategraphics
      If size.IsEmpty Then
      G.DrawImage(images(name), position)
      Else
      G.DrawImage(images(name), New Rectangle(position.X, position.Y, size.X, size.Y))
      End If
      End If
      Catch ex As Exception
      End Try
      End Sub
      End Class
      End Namespace
      for form1
      Imports GFX.GDI
      Public Class Form1
      Private ImgMan As IMmanager
      Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
      ImgMan.loadImage("Home", "Home.png")
      'ImgMan.loadImage("deadpool", "deadpool.png")
      End Sub
      Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
      ImgMan.drawImage(Me, "Home", New Point(0, 0), New Point(Me.Width, Me.Height))
      End Sub
      End Class

    • @georgegallimore6690
      @georgegallimore6690 8 років тому

      +VB Toolbox did you looked at the project?

    • @VBToolbox
      @VBToolbox  8 років тому

      +george gallimore Not yet, sorry. I don't get much time to program on the weekend and it was a holiday, as well.

    • @VBToolbox
      @VBToolbox  8 років тому

      +george gallimore I looked at the project and it looks like you were missing the "New" keyword when you declared ImgMan in your form.
      Is should look like this:
      Private ImgMan As New IMmanager

  • @user-cf2un7dh1g
    @user-cf2un7dh1g 4 роки тому

    good

  • @douglasteachout1958
    @douglasteachout1958 9 років тому +1

    I always use Option Strict On and the line Dim G as Graphics = Surface.CreateGraphics gives a late binding error. How can I get rid of this error (any ideas)?

    • @VBToolbox
      @VBToolbox  9 років тому +1

      I did a little test with Option Strict On and was able to get rid of the error by changing the parameter type from Object to Graphics.
      The call changes slightly.
      I used: *Public Sub DrawImage(Surface As Graphics, Name As String,....*
      Then I changed the lines below to this:
      Try
      If Images.ContainsKey(Name) Then
      Dim G As Graphics = Surface
      Then to call the Sub, use the object AND its CreateGraphics method for the parameter.
      Example:
      ImgMan.DrawImage(*Me.CreateGraphics*, "Bolt", New Point(0, 0), New Point(Me.Width, Me.Height))

  • @amoseder1825
    @amoseder1825 7 років тому

    FromFile brings an exception error it does not belong to System.Drawing

  • @MonikaSingh-jo6ux
    @MonikaSingh-jo6ux 4 роки тому

    plz give me the code for a sample program to create a user defined DLL

  • @mlc6143
    @mlc6143 2 роки тому

    create dll vb visual studio 2019 use in excel

  • @Uglydollsrises23132
    @Uglydollsrises23132 4 роки тому

    This tutorial also serves very well for review. The only issue I encountered with VS2019 was the Navigation Bar was missing. I found this answered at stackoverflow.com/questions/4240523/visual-studio-client-objects-events-drop-down-list-missing

    • @Ibrahim_Badri
      @Ibrahim_Badri 2 роки тому

      Hope you mark their answer as ACCEPTED

  • @piyarulislam9105
    @piyarulislam9105 9 років тому

    this is real

  • @indiora1913
    @indiora1913 3 роки тому +2

    I can't be the only one who thinks you kinda sound like BadBoyHalo

    • @VBToolbox
      @VBToolbox  2 роки тому +1

      Only much less exuberant and with waaaaaaaaay fewer views. 😅

    • @indiora1913
      @indiora1913 2 роки тому +2

      @@VBToolbox you’ll get there soon, keep your head high :)

  • @georgegallimore6690
    @georgegallimore6690 8 років тому

    it's not working for me, I follow your every step and all that i am getting is a BIG "X" in my form.
    give me some hint,

    • @VBToolbox
      @VBToolbox  8 років тому

      +george gallimore Hello, George. :-) You're using relative pathing for your image source. Did you ensure that "deadpool.png" is in your application folder ("bin/debug")?

    • @georgegallimore6690
      @georgegallimore6690 8 років тому

      i will recheck and get back to you, thanks in advance.

    • @georgegallimore6690
      @georgegallimore6690 8 років тому

      it still doesn't work, here am sending you the project: www.dropbox.com/s/ypykelqrqsqv9df/Image%20Dll%20File.rar?dl=0