home *** CD-ROM | disk | FTP | other *** search
Wrap
Imports System Imports System.Drawing Imports System.Collections Imports System.ComponentModel Imports System.Windows.Forms Imports System.Data Namespace Components Public Class Form1 Inherits System.Windows.Forms.Form Private mainMenu1 As System.Windows.Forms.MainMenu Private menuItem1 As System.Windows.Forms.MenuItem Private menuItem2 As System.Windows.Forms.MenuItem Private menuItem3 As System.Windows.Forms.MenuItem Private menuImageExtender1 As NETXP.Components.Extenders.MenuImageExtender Private imageStore1 As NETXP.Components.ImageStore Private WithEvents pictureBox1 As System.Windows.Forms.PictureBox Private WithEvents button1 As System.Windows.Forms.Button Private notifyBg As NETXP.Components.ImageStore Private notifyClose As NETXP.Components.ImageStore Private notifyIconEx1 As NETXP.Components.NotifyIconEx Private WithEvents button2 As System.Windows.Forms.Button Private components As System.ComponentModel.IContainer Public Sub New() ' ' Required for Windows Form Designer support ' InitializeComponent() ' ' TODO: Add any constructor code after InitializeComponent call ' End Sub Protected Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not components Is Nothing Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub #Region "Windows Form Designer generated code" Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1)) Me.mainMenu1 = New System.Windows.Forms.MainMenu Me.menuItem1 = New System.Windows.Forms.MenuItem Me.menuItem2 = New System.Windows.Forms.MenuItem Me.menuItem3 = New System.Windows.Forms.MenuItem Me.menuImageExtender1 = New NETXP.Components.Extenders.MenuImageExtender(Me.components) Me.imageStore1 = New NETXP.Components.ImageStore(Me.components) Me.pictureBox1 = New System.Windows.Forms.PictureBox Me.button1 = New System.Windows.Forms.Button Me.notifyBg = New NETXP.Components.ImageStore(Me.components) Me.notifyClose = New NETXP.Components.ImageStore(Me.components) Me.notifyIconEx1 = New NETXP.Components.NotifyIconEx Me.button2 = New System.Windows.Forms.Button Me.SuspendLayout() ' ' mainMenu1 ' Me.mainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.menuItem1}) ' ' menuItem1 ' Me.menuItem1.Index = 0 Me.menuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.menuItem2, Me.menuItem3}) Me.menuItem1.Text = "&Menu With Images" ' ' menuItem2 ' Me.menuImageExtender1.SetImage(Me.menuItem2, (CType((resources.GetObject("menuItem2.Image")), System.Drawing.Image))) Me.menuItem2.Index = 0 Me.menuItem2.OwnerDraw = True Me.menuItem2.Text = "&An Item" ' ' menuItem3 ' Me.menuImageExtender1.SetImage(Me.menuItem3, (CType((resources.GetObject("menuItem3.Image")), System.Drawing.Image))) Me.menuItem3.Index = 1 Me.menuItem3.OwnerDraw = True Me.menuItem3.Text = "Another &Item" ' ' imageStore1 ' Me.imageStore1.Image = (CType((resources.GetObject("imageStore1.Image")), System.Drawing.Image)) ' ' pictureBox1 ' Me.pictureBox1.Location = New System.Drawing.Point(32, 32) Me.pictureBox1.Name = "pictureBox1" Me.pictureBox1.Size = New System.Drawing.Size(128, 128) Me.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage Me.pictureBox1.TabIndex = 0 Me.pictureBox1.TabStop = False ' ' button1 ' Me.button1.Location = New System.Drawing.Point(312, 32) Me.button1.Name = "button1" Me.button1.Size = New System.Drawing.Size(144, 23) Me.button1.TabIndex = 1 Me.button1.Text = "Test &Taskbar Notifier" ' ' notifyBg ' Me.notifyBg.Image = (CType((resources.GetObject("notifyBg.Image")), System.Drawing.Image)) ' ' notifyClose ' Me.notifyClose.Image = (CType((resources.GetObject("notifyClose.Image")), System.Drawing.Image)) ' ' notifyIconEx1 ' Me.notifyIconEx1.Icon = (CType((resources.GetObject("notifyIconEx1.Icon")), System.Drawing.Icon)) Me.notifyIconEx1.Text = "This is a test of the NotifyIconEx." Me.notifyIconEx1.Visible = True ' ' button2 ' Me.button2.Location = New System.Drawing.Point(296, 96) Me.button2.Name = "button2" Me.button2.Size = New System.Drawing.Size(168, 23) Me.button2.TabIndex = 2 Me.button2.Text = "Test &Computer Browser" ' ' Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(480, 353) Me.Controls.Add(Me.button2) Me.Controls.Add(Me.button1) Me.Controls.Add(Me.pictureBox1) Me.Menu = Me.mainMenu1 Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) End Sub #End Region <STAThread()> _ Public Shared Sub Main(ByVal args As String()) Application.Run(New Form1) End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load 'use ImageStore Me.pictureBox1.Image = Me.imageStore1.Image Me.notifyIconEx1.ShowBalloon("Testing NotifyIconEx", "This is a balloon tip. This is impossible to do with the standard NotifyIcon.", NETXP.Components.NotifyInfoFlags.Info, 3000) End Sub Private Sub pictureBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles pictureBox1.Click Me.pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize End Sub Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.click Dim tn As NETXP.Components.TaskbarNotifier tn = New NETXP.Components.TaskbarNotifier tn.NormalTitleColor = SystemColors.HotTrack tn.NormalTitleFont = New Font(tn.NormalTitleFont, FontStyle.Bold) tn.NormalContentColor = SystemColors.WindowText tn.HoverContentColor = SystemColors.HotTrack tn.HoverTitleColor = SystemColors.ActiveCaption tn.HoverTitleFont = tn.NormalTitleFont tn.SetBackgroundBitmap(notifyBg.Image, Color.FromArgb(255, 0, 255)) tn.SetCloseBitmap(notifyClose.Image, Color.FromArgb(255, 0, 255), New Point(127, 8)) tn.TitleRectangle = New Rectangle(60, 12, 100, 30) tn.ContentRectangle = New Rectangle(8, 43, 133, 64) tn.Show("Notification", "The XMark service has started.", 250, 1500, 250) End Sub Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button2.click Dim brf As NETXP.Components.CompBrowser = New NETXP.Components.CompBrowser brf.ShowDialog(Me) MessageBox.Show(brf.SelectedComputer) End Sub End Class End Namespace