0

我创建了一个自定义类。我想在该类上创建一个 Bunifu 按钮,问题是 Visual Studio 让我创建的唯一控件类型是默认控件,因为我使用了 (System.Windows.Forms) 库。我怎样才能在课堂上调用 bunifu 按钮?也许打电话给一些图书馆?谢谢!:)

4

2 回答 2

2

您需要做的就是通过导航到文件在您的计算机中的位置,在您的项目中添加对Bunifu.UI.WinForms.BunifuButton.dll控件的引用,然后您可以在主窗体的Load事件中编写此示例代码:

[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)

希望这可以帮助!

于 2018-08-23T10:04:22.347 回答
0

您必须参考 Bunifu 框架,您可以从他们的网站下载它

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

添加Bunifu_UI_v1.5x.dll到您的 ptoject 转到toolbox--> Choose Items --> Browse 选择 dll 文件,您将拥有包括 Bunifu 按钮在内的所有工具。

于 2018-08-21T17:55:05.070 回答