C# Bunifu - How can I use/call any type of Bunifu control on a custom class?

5.4k Views Asked by At

I created a custom class. I want to create a Bunifu button on that class, the problem is the only type of controls that Visual Studio let me create is the defaults one, because I used the (System.Windows.Forms) library. How can I call a bunifu button on a class? Maybe call some library? Thank you! :)

2

There are 2 best solutions below

2
Dinu Kuruppu On

You have to reference to Bunifu framework you can download it from their website

https://bunifuframework.com/products/bunifu-ui-winforms/

add Bunifu_UI_v1.5x.dll to your ptoject Go to toolbox--> Choose Items --> Browse Select the dll file and you will have all the tools including Bunifu Button.

0
Willy Kimura On

All you'll need to do is add a reference to the Bunifu.UI.WinForms.BunifuButton.dll control in your project by navigating to where the file is located in your Computer, then you can write this sample code in your main Form's Load event:

[C#]

            Bunifu.UI.WinForms.BunifuButton.BunifuButton bunifuButton = 
            new BunifuButton.BunifuButton();

            bunifuButton.Location = new System.Drawing.Point(70, 70);
            bunifuButton.ButtonText = "Hello world";

            bunifuButton.Click += (senderObject, eventArgs) => {
                MessageBox.Show("Hello there..."); 
            };

            Controls.Add(bunifuButton);

[VB.NET]

            Dim bunifuButton As New Bunifu.UI.WinForms.BunifuButton.BunifuButton()

            bunifuButton.Location = new System.Drawing.Point(70, 70)
            bunifuButton.ButtonText = "Hello world"

            AddHandler bunifuButton.Click, Sub(senderObject, eventArgs)
                MsgBox("Hello there...")
            End Sub

            Controls.Add(bunifuButton)

Hope this helps!