defaultvb.aspx.vb

来自「Telerik是很大的第三方软件制造商」· VB 代码 · 共 89 行

VB
89
字号

Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports Telerik.WebControls


Namespace Telerik.MenuExamplesVBNET.Menu.Examples.Design.CheckUncheck
   
   '/ <summary>
   '/ Summary description for DefaultCS.
   '/ </summary>
   Public Class DefaultVB
      Inherits Telerik.QuickStart.XhtmlPage
      Protected WithEvents Menu1 As RadMenu
      Protected Message As Label
      
      
      Private Sub ProcessItemClickedEvent(sender As Object, e As ItemEventArgs) Handles Menu1.ItemClicked
         Dim ItemClicked As Telerik.WebControls.MenuItem = e.Item
         
         If Not (ItemClicked.ParentGroup Is Nothing) Then
            If ItemClicked.ParentGroup.ID.Equals("mode") Then
               Dim Item As Telerik.WebControls.MenuItem
               For Each Item In  ItemClicked.ParentGroup.Items
                  Item.LeftLogo = [String].Empty
               Next Item 
               ItemClicked.LeftLogo = "circle.gif"
            ElseIf ItemClicked.ParentGroup.ID.Equals("advanced") Then
               If ItemClicked.LeftLogo <> [String].Empty Then
                  ItemClicked.LeftLogo = [String].Empty
               Else
                  ItemClicked.LeftLogo = "check.gif"
               End If
            End If
         End If 
         Dim mes As [String] = "Current settings: "
         If Not (ItemClicked.ParentGroup Is Nothing) Then
            Dim Item As Telerik.WebControls.MenuItem
            For Each Item In  Menu1.FindGroupById("mode").Items
               If Item.LeftLogo <> [String].Empty Then
                  mes = mes + Item.Text
               End If
            Next Item
         End If 
         If Not (ItemClicked.ParentGroup Is Nothing) Then
            Dim Item As Telerik.WebControls.MenuItem
            For Each Item In  Menu1.FindGroupById("advanced").Items
               mes += "<br/>" + Item.Text + "&nbsp"
               If Item.LeftLogo <> [String].Empty Then
                  mes += "<b>ON</b>"
               Else
                  mes += "<b>OFF</b>"
               End If
            Next Item
         End If
         Message.Text = mes
      End Sub 'ProcessItemClickedEvent
       
      
      Private Sub Page_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
         If Not IsPostBack Then
            Message.Text = "Change the settings to see result here."
         End If ' Put user code to initialize the page here
      End Sub 'Page_Load
      Protected Overrides Sub OnInit(e As EventArgs)
         '
         ' CODEGEN: This call is required by the ASP.NET Web Form Designer.
         '
         InitializeComponent()
         MyBase.OnInit(e)
      End Sub 'OnInit
      
      
      '/ <summary>
      '/ Required method for Designer support - do not modify
      '/ the contents of this method with the code editor.
      '/ </summary>
      Private Sub InitializeComponent()
      End Sub 'InitializeComponent
   End Class 'DefaultVB 
End Namespace 'Telerik.MenuExamplesVBNET.Menu.Examples.Design.CheckUncheck

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?