惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - 天使爱比目鱼

微软日期格式的改变造成程序崩溃 .NET 中DataGridViewComboBoxCell控件得Bug 也谈解决Combobox绑定数据后取值出现System.Data.DataRowView的问题 在SQL Server 2014下面使用的SQL2000的Northwind和Pubs示例数据库 去除Linq to Sql 查询结果中的空格 VS2015中DataGridView的DataGridViewComBoboxCell列值无效及数据绑定错误的解决方法 DevExpress学习笔记1-ProductsDemo.Win 在VB中使用Linq To SQLite注意事项 在VB中利用Nuget包使用SQLite数据库和Linq to SQLite 在C#中利用Nuget包使用SQLite数据库和Linq to SQLite VB.NET中使用Linq TO SQL添加数据后获得自增长列ID [转载代码]VB.NET 中查询 Linq to SQL 执行时的SQL语句 Linq to SQL 绑定 ComboBox 在VS.NET中根据条件设置不同的MainForm 在T-SQL中使用参数将XML数据添加到SQL数据库的XML列 [转载自键舞者]SELECT IDENT_CURRENT(tableName)获得自增长列ID的实现 测试Windows Live Writer 4步搞定:系统必备的安装位置未设置为组件供应商的网站,无法在磁盘上找到 dotNetFx40LP_Client_x86_x64cs.exe 问题的解决方案 VS2010 SP1 简体中文测试通过,繁体未测试 控件命名规范(转自CSDN)
VB.NET在基类中定义共享事件(类似于C#中的静态事件)
天使爱比目鱼 · 2020-06-21 · via 博客园 - 天使爱比目鱼

    基类:

Public Class userFun
    Private Shared _PnlStatus As String ‘必须设为共享字段,如果不设为Shared,将不能传递字符串内容
    Public Delegate Sub EventHandler()
    Public Shared Event PnlStatusChanged As EventHandler ’共享事件,如果不设为Shared,将不能触发主窗体中的事件

    Public Property PnlStatus As String ‘类属性
        Get
            Return _PnlStatus
        End Get
        Set(value As String)
            _PnlStatus = value
            RaiseEvent PnlStatusChanged() ’触发事件
        End Set
    End Property
End Class

用户自定义控件ucOrder中设置状态信息:

Public Class ucOrder    
   Private objuserFun As New userFun
   objuserFun.PnlStatus = "新建订单!"
End Class

主窗体中显示状态信息:

Public Class frmAdmin
    Private WithEvents objuserFun As New userFun ’添加WithEvents,显式调用事件
    Private Sub objuserFun_PnlStatusChanged() Handles objuserFun.PnlStatusChanged
       PnlStatus.Text = objuserFun.PnlStatus ’主窗体显示状态信息
    End Sub
End Class

总结:VB中的共享事件感觉跟C#中的静态事件差不多。