vb.net求解释

 

 

Public Class Main
    Public Sub PingBiAll()
        Dim ct As ToolStripItem
        For Each ct In cd00.DropDownItems
            ct.Enabled = False
        Next
        For Each ct In cd01.DropDownItems
            ct.Enabled = False
        Next
        For Each ct In cd02.DropDownItems
            ct.Enabled = False
        Next
        For Each ct In cd03.DropDownItems
            ct.Enabled = False
     
        Next
        For Each ct In cd04.DropDownItems
            ct.Enabled = False
        Next
        For Each ct In cd05.DropDownItems
            ct.Enabled = False
        Next
    End Sub

    Public Sub PingBi()
        PingBiAll()
        cd00.Enabled = True
        cd0000.Enabled = True
        cd0004.Enabled = True
    End Sub

    Public Sub QXControl()
        Me.PingBi() '将菜单项屏蔽
        strSQL = " SELECT * FROM TQx_QxInfo where RoleID=@CS1"
        SelectChar1(strSQL, RoleId)
        Dim a As Integer
        Dim b As Integer
        Dim c As Boolean

        While (dr.Read)
            a = Val(Mid(dr(2).ToString, 1, 2))
            b = Val(Mid(dr(2).ToString, 3, 2))
            c = dr("IsEnabled")
            If (c) Then
                If a = 0 Then
                    cd00.DropDownItems(b).Enabled = True
                End If
                If a = 1 Then
                    cd01.DropDownItems(b).Enabled = True
                End If
                If a = 2 Then
                    cd02.DropDownItems(b).Enabled = True
                End If
             
            End If
        End While
        con.Close()

        TiShi1.Visible = True
        TiShi1.Text = "用户名:" + CurUser
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If QXFlag Then
            QXControl()
            QXFlag = False
        End If

    End Sub

    Private Sub Main_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        End
    End Sub

    Private Sub cd0000_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0000.Click
        PingBiAll()
        Login.Visible = True

    End Sub


    Private Sub cd0004_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0004.Click
        Close()
    End Sub
    Private Sub cd0002_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0002.Click
        PingBiAll()
        Dim frmRoleManage As New RoleManage
        frmRoleManage.MdiParent = Me
        frmRoleManage.Show()
    End Sub

    Private Sub cd0001_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0001.Click
        PingBiAll()
        Dim frmUserManage As New UserManage
        frmUserManage.MdiParent = Me
        frmUserManage.Show()

    End Sub

  

    Private Sub cd0003_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0003.Click
        PingBiAll()
        Dim frmModifyUseerPas As New ModifyUseerPas
        frmModifyUseerPas.MdiParent = Me
        frmModifyUseerPas.Show()

    End Sub


 
    Private Sub cd0100_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0100.Click
        PingBiAll()
        Dim frmzhuhu As New zhuhu
        frmzhuhu.MdiParent = Me
        frmzhuhu.Show()
    End Sub

    Private Sub cd0101_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0101.Click
        PingBiAll()
        Dim frmfangchan As New fangchan
        frmfangchan.MdiParent = Me
        frmfangchan.Show()
    End Sub

    Private Sub cd0200_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0200.Click
        PingBiAll()
        Dim frmtousu As New tousu
        frmtousu.MdiParent = Me
        frmtousu.Show()
    End Sub

    Private Sub cd0201_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0201.Click
        PingBiAll()
        Dim frmbaoxiu As New baoxiu
        frmbaoxiu.MdiParent = Me
        frmbaoxiu.Show()
    End Sub

    Private Sub cd0300_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0300.Click
        PingBiAll()
        Dim frmchewei As New chewei
        frmchewei.MdiParent = Me
        frmchewei.Show()
    End Sub

    Private Sub cd0301_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0301.Click
        PingBiAll()
        Dim frmtingche As New tingche
        frmtingche.MdiParent = Me
        frmtingche.Show()
    End Sub

    Private Sub cd0400_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cd0400.Click
        PingBiAll()
        Dim frmshoufei As New shoufei
        frmshoufei.MdiParent = Me
        frmshoufei.Show()
    End Sub
End Class

 

菜鸟来袭  求高手解决
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值