【问题标题】:How to write out button event without using WPF controls?如何在不使用 WPF 控件的情况下写出按钮事件?
【发布时间】:2015-08-30 01:06:00
【问题描述】:

我不知道如何在标题中指定,这是在 WPF Visual Basic 中。我想知道如何编写代码,以便在单击按钮时,选项卡控件选择将为 = 1

这是我的主窗口 RightWindowCommands 中的内容:

 <Button Content="Information" Cursor="Hand" Click="InformationButton_OnClick"
                      ToolTip="View the information"
                      x:Name="InformationView"/>

但是,我没有使用 WPF 工具的按钮,因为这是一个 GUI,我必须将按钮放在 RightWindowCommands,我想知道如何输出代码以便InformationButton_OnClick 给我@987654323 @。请指导我写出这段代码

【问题讨论】:

  • 需要帮助!我只能在 C# 中找到解决方案,但在 VB 中找不到!我对此很陌生,请指导我!

标签: wpf vb.net visual-studio wpf-controls


【解决方案1】:

这是处理图片的 onclick 事件的一个很好的示例,您可以将其更改为数字而不是图片。

`AddHandler pic.Click, AddressOf pic_Click'

Private Sub pic_Click(ByVal sender As Object, ByVal e As EventArgs)
    Dim pic As PictureBox = DirectCast(sender, PictureBox)
    ' etc...
End Sub

来源:add on click event to picturebox vb.net

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-14
    相关资源
    最近更新 更多