home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 October / CMCD1004.ISO / Software / Shareware / Programare / netxp / netxp.exe / Samples / VB / TaskPane / Form1.vb < prev    next >
Encoding:
Text File  |  2004-04-09  |  11.1 KB  |  247 lines

  1. Imports System
  2. Imports System.Drawing
  3. Imports System.Collections
  4. Imports System.ComponentModel
  5. Imports System.Windows.Forms
  6. Imports System.Data
  7.  
  8. Namespace TaskPane
  9.     Public Class Form1
  10.         Inherits System.Windows.Forms.Form
  11.         Private xpTaskPane1 As NETXP.Controls.TaskPane.XPTaskPane
  12.         Private xpTaskPaneGroup1 As NETXP.Controls.TaskPane.XPTaskPaneGroup
  13.         Private xpTaskPaneGroup2 As NETXP.Controls.TaskPane.XPTaskPaneGroup
  14.         Private xpLink1 As NETXP.Controls.TaskPane.XPLink
  15.         Private xpLink2 As NETXP.Controls.TaskPane.XPLink
  16.         Private xpLink3 As NETXP.Controls.TaskPane.XPLink
  17.         Private xpLink4 As NETXP.Controls.TaskPane.XPLink
  18.         Private panel1 As System.Windows.Forms.Panel
  19.         Private splitter1 As System.Windows.Forms.Splitter
  20.         Private WithEvents radioButton1 As System.Windows.Forms.RadioButton
  21.         Private WithEvents radioButton2 As System.Windows.Forms.RadioButton
  22.         Private components As System.ComponentModel.Container
  23.  
  24.         Public Sub New()
  25.             '
  26.             ' Required for Windows Form Designer support
  27.             '
  28.             InitializeComponent()
  29.  
  30.             '
  31.             ' TODO: Add any constructor code after InitializeComponent call
  32.             '
  33.         End Sub
  34.  
  35.         Protected Overrides Sub Dispose(ByVal disposing As Boolean)
  36.             If disposing Then
  37.                 If Not components Is Nothing Then
  38.                     components.Dispose()
  39.                 End If
  40.             End If
  41.             MyBase.Dispose(disposing)
  42.         End Sub
  43.  
  44. #Region "Windows Form Designer generated code"
  45.         Private Sub InitializeComponent()
  46.             Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
  47.             Me.xpTaskPane1 = New NETXP.Controls.TaskPane.XPTaskPane
  48.             Me.xpTaskPaneGroup2 = New NETXP.Controls.TaskPane.XPTaskPaneGroup
  49.             Me.xpLink2 = New NETXP.Controls.TaskPane.XPLink
  50.             Me.xpLink1 = New NETXP.Controls.TaskPane.XPLink
  51.             Me.xpTaskPaneGroup1 = New NETXP.Controls.TaskPane.XPTaskPaneGroup
  52.             Me.xpLink4 = New NETXP.Controls.TaskPane.XPLink
  53.             Me.xpLink3 = New NETXP.Controls.TaskPane.XPLink
  54.             Me.panel1 = New System.Windows.Forms.Panel
  55.             Me.radioButton2 = New System.Windows.Forms.RadioButton
  56.             Me.radioButton1 = New System.Windows.Forms.RadioButton
  57.             Me.splitter1 = New System.Windows.Forms.Splitter
  58.             Me.xpTaskPane1.SuspendLayout()
  59.             Me.xpTaskPaneGroup2.SuspendLayout()
  60.             Me.xpTaskPaneGroup1.SuspendLayout()
  61.             Me.panel1.SuspendLayout()
  62.             Me.SuspendLayout()
  63.             ' 
  64.             ' xpTaskPane1
  65.             ' 
  66.             Me.xpTaskPane1.AutoScroll = True
  67.             Me.xpTaskPane1.Controls.Add(Me.xpTaskPaneGroup2)
  68.             Me.xpTaskPane1.Controls.Add(Me.xpTaskPaneGroup1)
  69.             Me.xpTaskPane1.Dock = System.Windows.Forms.DockStyle.Left
  70.             Me.xpTaskPane1.Location = New System.Drawing.Point(0, 0)
  71.             Me.xpTaskPane1.Name = "xpTaskPane1"
  72.             Me.xpTaskPane1.Size = New System.Drawing.Size(200, 414)
  73.             Me.xpTaskPane1.TabIndex = 0
  74.             Me.xpTaskPane1.Text = "xpTaskPane1"
  75.             ' 
  76.             ' xpTaskPaneGroup2
  77.             ' 
  78.             Me.xpTaskPaneGroup2.Controls.Add(Me.xpLink2)
  79.             Me.xpTaskPaneGroup2.Controls.Add(Me.xpLink1)
  80.             Me.xpTaskPaneGroup2.Image = (CType((resources.GetObject("xpTaskPaneGroup2.Image")), System.Drawing.Image))
  81.             Me.xpTaskPaneGroup2.Location = New System.Drawing.Point(16, 128)
  82.             Me.xpTaskPaneGroup2.Name = "xpTaskPaneGroup2"
  83.             Me.xpTaskPaneGroup2.Size = New System.Drawing.Size(168, 80)
  84.             Me.xpTaskPaneGroup2.TabIndex = 1
  85.             Me.xpTaskPaneGroup2.Text = "Normal Tasks"
  86.             ' 
  87.             ' xpLink2
  88.             ' 
  89.             Me.xpLink2.BackColor = System.Drawing.Color.Transparent
  90.             Me.xpLink2.Cursor = System.Windows.Forms.Cursors.Hand
  91.             Me.xpLink2.Image = (CType((resources.GetObject("xpLink2.Image")), System.Drawing.Image))
  92.             Me.xpLink2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
  93.             Me.xpLink2.Location = New System.Drawing.Point(8, 56)
  94.             Me.xpLink2.Name = "xpLink2"
  95.             Me.xpLink2.Size = New System.Drawing.Size(136, 16)
  96.             Me.xpLink2.TabIndex = 1
  97.             Me.xpLink2.Text = "Connect to Network"
  98.             Me.xpLink2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
  99.             ' 
  100.             ' xpLink1
  101.             ' 
  102.             Me.xpLink1.BackColor = System.Drawing.Color.Transparent
  103.             Me.xpLink1.Cursor = System.Windows.Forms.Cursors.Hand
  104.             Me.xpLink1.Image = (CType((resources.GetObject("xpLink1.Image")), System.Drawing.Image))
  105.             Me.xpLink1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
  106.             Me.xpLink1.Location = New System.Drawing.Point(8, 32)
  107.             Me.xpLink1.Name = "xpLink1"
  108.             Me.xpLink1.Size = New System.Drawing.Size(136, 16)
  109.             Me.xpLink1.TabIndex = 0
  110.             Me.xpLink1.Text = "Clean Hard Disk"
  111.             Me.xpLink1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
  112.             ' 
  113.             ' xpTaskPaneGroup1
  114.             ' 
  115.             Me.xpTaskPaneGroup1.Controls.Add(Me.xpLink4)
  116.             Me.xpTaskPaneGroup1.Controls.Add(Me.xpLink3)
  117.             Me.xpTaskPaneGroup1.Image = (CType((resources.GetObject("xpTaskPaneGroup1.Image")), System.Drawing.Image))
  118.             Me.xpTaskPaneGroup1.Location = New System.Drawing.Point(16, 16)
  119.             Me.xpTaskPaneGroup1.Name = "xpTaskPaneGroup1"
  120.             Me.xpTaskPaneGroup1.Size = New System.Drawing.Size(168, 88)
  121.             Me.xpTaskPaneGroup1.SpecialTasks = True
  122.             Me.xpTaskPaneGroup1.TabIndex = 0
  123.             Me.xpTaskPaneGroup1.Text = "Special Tasks"
  124.             ' 
  125.             ' xpLink4
  126.             ' 
  127.             Me.xpLink4.BackColor = System.Drawing.Color.Transparent
  128.             Me.xpLink4.Cursor = System.Windows.Forms.Cursors.Hand
  129.             Me.xpLink4.Image = (CType((resources.GetObject("xpLink4.Image")), System.Drawing.Image))
  130.             Me.xpLink4.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
  131.             Me.xpLink4.Location = New System.Drawing.Point(8, 64)
  132.             Me.xpLink4.Name = "xpLink4"
  133.             Me.xpLink4.Size = New System.Drawing.Size(144, 16)
  134.             Me.xpLink4.TabIndex = 1
  135.             Me.xpLink4.Text = "Disk Backup"
  136.             Me.xpLink4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
  137.             ' 
  138.             ' xpLink3
  139.             ' 
  140.             Me.xpLink3.BackColor = System.Drawing.Color.Transparent
  141.             Me.xpLink3.Cursor = System.Windows.Forms.Cursors.Hand
  142.             Me.xpLink3.Image = (CType((resources.GetObject("xpLink3.Image")), System.Drawing.Image))
  143.             Me.xpLink3.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
  144.             Me.xpLink3.Location = New System.Drawing.Point(8, 40)
  145.             Me.xpLink3.Name = "xpLink3"
  146.             Me.xpLink3.Size = New System.Drawing.Size(144, 16)
  147.             Me.xpLink3.TabIndex = 0
  148.             Me.xpLink3.Text = "Open Shortcut"
  149.             Me.xpLink3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
  150.             ' 
  151.             ' panel1
  152.             ' 
  153.             Me.panel1.BackColor = System.Drawing.SystemColors.Window
  154.             Me.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
  155.             Me.panel1.Controls.Add(Me.radioButton2)
  156.             Me.panel1.Controls.Add(Me.radioButton1)
  157.             Me.panel1.Controls.Add(Me.splitter1)
  158.             Me.panel1.Dock = System.Windows.Forms.DockStyle.Fill
  159.             Me.panel1.Location = New System.Drawing.Point(200, 0)
  160.             Me.panel1.Name = "panel1"
  161.             Me.panel1.Size = New System.Drawing.Size(360, 414)
  162.             Me.panel1.TabIndex = 1
  163.             ' 
  164.             ' radioButton2
  165.             ' 
  166.             Me.radioButton2.Location = New System.Drawing.Point(64, 72)
  167.             Me.radioButton2.Name = "radioButton2"
  168.             Me.radioButton2.Size = New System.Drawing.Size(168, 24)
  169.             Me.radioButton2.TabIndex = 2
  170.             Me.radioButton2.Text = "Custom Colors"
  171.             ' 
  172.             ' radioButton1
  173.             ' 
  174.             Me.radioButton1.Checked = True
  175.             Me.radioButton1.Location = New System.Drawing.Point(64, 48)
  176.             Me.radioButton1.Name = "radioButton1"
  177.             Me.radioButton1.Size = New System.Drawing.Size(168, 24)
  178.             Me.radioButton1.TabIndex = 1
  179.             Me.radioButton1.TabStop = True
  180.             Me.radioButton1.Text = "Windows Default Colors"
  181.             ' 
  182.             ' splitter1
  183.             ' 
  184.             Me.splitter1.Location = New System.Drawing.Point(0, 0)
  185.             Me.splitter1.Name = "splitter1"
  186.             Me.splitter1.Size = New System.Drawing.Size(3, 410)
  187.             Me.splitter1.TabIndex = 0
  188.             Me.splitter1.TabStop = False
  189.             ' 
  190.             ' Form1
  191.             ' 
  192.             Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
  193.             Me.ClientSize = New System.Drawing.Size(560, 414)
  194.             Me.Controls.Add(Me.panel1)
  195.             Me.Controls.Add(Me.xpTaskPane1)
  196.             Me.Icon = (CType((resources.GetObject("$this.Icon")), System.Drawing.Icon))
  197.             Me.Name = "Form1"
  198.             Me.Text = "Test Form"
  199.             Me.xpTaskPane1.ResumeLayout(False)
  200.             Me.xpTaskPaneGroup2.ResumeLayout(False)
  201.             Me.xpTaskPaneGroup1.ResumeLayout(False)
  202.             Me.panel1.ResumeLayout(False)
  203.             Me.ResumeLayout(False)
  204.         End Sub
  205. #End Region
  206.  
  207.         <STAThread()> _
  208.         Public Shared Sub Main(ByVal args As String())
  209.             Application.Run(New Form1)
  210.         End Sub
  211.  
  212.         Private Sub radioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles radiobutton1.checkedchanged
  213.             If radioButton1.Checked Then
  214.                 Me.xpTaskPane1.ColorTable = NETXP.Library.ColorTables.Dynamic
  215.             End If
  216.         End Sub
  217.  
  218.         Private Sub radioButton2_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles radiobutton2.checkedchanged
  219.             If radioButton2.Checked Then
  220.                 Me.xpTaskPane1.ColorTable = New CustomColors
  221.             End If
  222.         End Sub
  223.     End Class
  224.     Friend Class CustomColors
  225.         Implements NETXP.Library.IColorTable
  226. #Region "IColorTable Members"
  227.  
  228.         Private icolors As NETXP.Library.ColorCollection
  229.  
  230.         Public Sub New()
  231.             icolors = New NETXP.Library.ColorCollection
  232.             Dim clr As Color
  233.             For Each clr In NETXP.Library.ColorTables.XPOlive.Colors
  234.                 icolors.Add(Color.FromArgb(clr.G, clr.B, clr.B))
  235.             Next
  236.         End Sub
  237.  
  238.         Public Overridable ReadOnly Property Colors() As NETXP.Library.ColorCollection Implements NETXP.Library.IColorTable.Colors
  239.             Get
  240.                 Return icolors
  241.             End Get
  242.         End Property
  243.  
  244. #End Region
  245.     End Class
  246. End Namespace
  247.