【发布时间】:2018-08-21 17:39:42
【问题描述】:
我创建了一个自定义类。我想在该类上创建一个 Bunifu 按钮,问题是 Visual Studio 让我创建的唯一控件类型是默认控件,因为我使用了 (System.Windows.Forms) 库。 如何在课堂上调用布尼夫按钮?也许打电话给一些图书馆?谢谢! :)
【问题讨论】:
我创建了一个自定义类。我想在该类上创建一个 Bunifu 按钮,问题是 Visual Studio 让我创建的唯一控件类型是默认控件,因为我使用了 (System.Windows.Forms) 库。 如何在课堂上调用布尼夫按钮?也许打电话给一些图书馆?谢谢! :)
【问题讨论】:
您需要做的就是在您的项目中添加对 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)
希望这会有所帮助!
【讨论】:
你必须参考 Bunifu 框架,你可以从他们的网站下载它
https://bunifuframework.com/products/bunifu-ui-winforms/
将 Bunifu_UI_v1.5x.dll 添加到您的 ptoject
转至toolbox--> Choose Items --> Browse
选择dll文件,您将拥有包括Bunifu Button在内的所有工具。
【讨论】: