【问题标题】:C# Bunifu - How can I use/call any type of Bunifu control on a custom class?C# Bunifu - 如何在自定义类上使用/调用任何类型的 Bunifu 控件?
【发布时间】:2018-08-21 17:39:42
【问题描述】:

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

【问题讨论】:

    标签: c# windows bunifu


    【解决方案1】:

    您需要做的就是在您的项目中添加对 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)
    

    希望这会有所帮助!

    【讨论】:

      【解决方案2】:

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

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

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

      【讨论】:

      • 你得付钱,如果你失去许可证你甚至不能打开你的项目,我不建议你的项目使用 bunifu 框架
      • 我有 dll 兄弟,我认为你没有理解我的问题。我有一个类,我想从代码中声明一个按钮。就像 Button button_example = new Button(),我想用 bunifu 来做,对吧?但它不会让我,也许是因为图书馆什么的。
      猜你喜欢
      • 1970-01-01
      • 2019-07-17
      • 1970-01-01
      • 2018-09-03
      • 2023-01-04
      • 1970-01-01
      • 1970-01-01
      • 2011-02-20
      • 1970-01-01
      相关资源
      最近更新 更多