我如何使用项目经理在VB.Net中生成的My.Settings验证设置?

问题描述 投票:0回答:1

下面的代码不起作用,错误表明方法ValidateSettings没有与代理'Delgate Sub SettingChangingEventHandler(sender as Object, e as SettingChangingEventArgs)'兼容的签名

将鼠标悬停在[...] AddressOf ValidateSettings上时显示此错误>

    Private Sub ValidateSettings(sender As Object, e As SettingChangingEventArgs)


    End Sub

    Private Sub frm_Settings_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        AddHandler My.Settings.SettingChanging, AddressOf ValidateSettings
        PropertyGrid_Settings.SelectedObject = My.Settings
        CenterToParent()
    End Sub

Im using this tutorial

下面的代码不起作用,错误表明方法ValidateSettings没有与delgate'Delgate Sub SettingChangingEventHandler(sender as Object,e as ...

vb.net validation event-handling settings my.settings
1个回答
0
投票

解决方案是将Imports System.Configuration添加到类中,如对原始帖子的评论所指出的。

© www.soinside.com 2019 - 2024. All rights reserved.