Click here to Skip to main content
15,920,896 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Very large LinkedList Pin
TheDarkMan8-Sep-05 10:34
TheDarkMan8-Sep-05 10:34 
QuestionClone (deep copy) datagrid Pin
mikone7-Sep-05 23:56
mikone7-Sep-05 23:56 
QuestionActiveX EXE Pin
MohammadAmiry7-Sep-05 23:29
MohammadAmiry7-Sep-05 23:29 
AnswerRe: ActiveX EXE Pin
Steve Pullan8-Sep-05 17:45
Steve Pullan8-Sep-05 17:45 
Questionwhy my timer control(or threading.timer) not run under win2003? Pin
woodwell7-Sep-05 22:56
woodwell7-Sep-05 22:56 
AnswerRe: why my timer control(or threading.timer) not run under win2003? Pin
woodwell8-Sep-05 14:19
woodwell8-Sep-05 14:19 
GeneralRe: why my timer control(or threading.timer) not run under win2003? Pin
Steve Pullan8-Sep-05 17:49
Steve Pullan8-Sep-05 17:49 
GeneralRe: why my timer control(or threading.timer) not run under win2003? Pin
woodwell8-Sep-05 18:15
woodwell8-Sep-05 18:15 
following is the code. there is some chinese words,but it is not important. and i give the mainly meaning . thanks for help me! i can't find error in it.

Public Class Form1<br />
<br />
    Inherits System.Windows.Forms.Form<br />
    Dim PathString As String = System.Windows.Forms.Application.StartupPath & "\", PL() As PlugStructure<br />
    Dim StartTime As Date = Now<br />
    Dim Tcb As Threading.TimerCallback<br />
    Dim Tmr As Threading.Timer<br />
<br />
    Structure PlugStructure<br />
        Dim Name As String<br />
        Dim Guid As String<br />
        Dim Status As PlugStatus<br />
        Dim Ins As PlugIns.piInterface<br />
        Dim Tab As TabPage<br />
        Dim Txt As TextBox<br />
    End Structure<br />
<br />
    Enum PlugStatus<br />
        Loaded = 0<br />
        Starting = 1<br />
        Running = 2<br />
        Stopping = 3<br />
        Stopped = 4<br />
        Unloaded = 5<br />
    End Enum<br />
<br />
#Region " Windows 窗体设计器生成的代码 " '  this means code generation by windows form designer<br />
<br />
    Public Sub New()<br />
        MyBase.New()<br />
<br />
        InitializeComponent()<br />
<br />
    End Sub<br />
<br />
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)<br />
        If disposing Then<br />
            If Not (components Is Nothing) Then<br />
                components.Dispose()<br />
            End If<br />
        End If<br />
        MyBase.Dispose(disposing)<br />
    End Sub<br />
<br />
    Private components As System.ComponentModel.IContainer<br />
<br />
    Friend WithEvents TabControl1 As System.Windows.Forms.TabControl<br />
    Friend WithEvents TabPage1 As System.Windows.Forms.TabPage<br />
    Friend WithEvents TxtMain As System.Windows.Forms.TextBox<br />
    Friend WithEvents RightClick As System.Windows.Forms.ContextMenu<br />
    Friend WithEvents NotifyIcon1 As System.Windows.Forms.NotifyIcon<br />
    Friend WithEvents ShowMain As System.Windows.Forms.MenuItem<br />
    Friend WithEvents NoUse As System.Windows.Forms.MenuItem<br />
    Friend WithEvents EndProgram As System.Windows.Forms.MenuItem<br />
    Friend WithEvents PnlRunTime As System.Windows.Forms.StatusBarPanel<br />
    Friend WithEvents PnlRoundTimes As System.Windows.Forms.StatusBarPanel<br />
    Friend WithEvents PnlPlugIns As System.Windows.Forms.StatusBarPanel<br />
    Friend WithEvents STBInfo As System.Windows.Forms.StatusBar<br />
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()<br />
        Me.components = New System.ComponentModel.Container<br />
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))<br />
        Me.TabControl1 = New System.Windows.Forms.TabControl<br />
        Me.TabPage1 = New System.Windows.Forms.TabPage<br />
        Me.TxtMain = New System.Windows.Forms.TextBox<br />
        Me.RightClick = New System.Windows.Forms.ContextMenu<br />
        Me.ShowMain = New System.Windows.Forms.MenuItem<br />
        Me.NoUse = New System.Windows.Forms.MenuItem<br />
        Me.EndProgram = New System.Windows.Forms.MenuItem<br />
        Me.NotifyIcon1 = New System.Windows.Forms.NotifyIcon(Me.components)<br />
        Me.STBInfo = New System.Windows.Forms.StatusBar<br />
        Me.PnlRunTime = New System.Windows.Forms.StatusBarPanel<br />
        Me.PnlRoundTimes = New System.Windows.Forms.StatusBarPanel<br />
        Me.PnlPlugIns = New System.Windows.Forms.StatusBarPanel<br />
        Me.TabControl1.SuspendLayout()<br />
        CType(Me.PnlRunTime, System.ComponentModel.ISupportInitialize).BeginInit()<br />
        CType(Me.PnlRoundTimes, System.ComponentModel.ISupportInitialize).BeginInit()<br />
        CType(Me.PnlPlugIns, System.ComponentModel.ISupportInitialize).BeginInit()<br />
        Me.SuspendLayout()<br />
        '<br />
        'TabControl1<br />
        '<br />
        Me.TabControl1.Appearance = System.Windows.Forms.TabAppearance.FlatButtons<br />
        Me.TabControl1.Controls.Add(Me.TabPage1)<br />
        Me.TabControl1.Location = New System.Drawing.Point(24, 16)<br />
        Me.TabControl1.Name = "TabControl1"<br />
        Me.TabControl1.SelectedIndex = 0<br />
        Me.TabControl1.Size = New System.Drawing.Size(648, 24)<br />
        Me.TabControl1.TabIndex = 0<br />
        '<br />
        'TabPage1<br />
        '<br />
        Me.TabPage1.Location = New System.Drawing.Point(4, 24)<br />
        Me.TabPage1.Name = "TabPage1"<br />
        Me.TabPage1.Size = New System.Drawing.Size(640, 0)<br />
        Me.TabPage1.TabIndex = 0<br />
        Me.TabPage1.Tag = "Main"<br />
        Me.TabPage1.Text = "Main Form"<br />
        '<br />
        'TxtMain<br />
        '<br />
        Me.TxtMain.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _<br />
                    Or System.Windows.Forms.AnchorStyles.Left) _<br />
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)<br />
        Me.TxtMain.Location = New System.Drawing.Point(24, 40)<br />
        Me.TxtMain.Multiline = True<br />
        Me.TxtMain.Name = "TxtMain"<br />
        Me.TxtMain.ReadOnly = True<br />
        Me.TxtMain.Size = New System.Drawing.Size(648, 184)<br />
        Me.TxtMain.TabIndex = 0<br />
        Me.TxtMain.Text = ""<br />
        '<br />
        'RightClick<br />
        '<br />
        Me.RightClick.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.ShowMain, Me.NoUse, Me.EndProgram})<br />
        '<br />
        'ShowMain<br />
        '<br />
        Me.ShowMain.DefaultItem = True<br />
        Me.ShowMain.Index = 0<br />
        Me.ShowMain.Text = "Show Me"<br />
        '<br />
        'NoUse<br />
        '<br />
        Me.NoUse.Index = 1<br />
        Me.NoUse.Text = "-"<br />
        '<br />
        'EndProgram<br />
        '<br />
        Me.EndProgram.Index = 2<br />
        Me.EndProgram.Text = "Quit"<br />
        '<br />
        'NotifyIcon1<br />
        '<br />
        Me.NotifyIcon1.ContextMenu = Me.RightClick<br />
        Me.NotifyIcon1.Icon = CType(resources.GetObject("NotifyIcon1.Icon"), System.Drawing.Icon)<br />
        Me.NotifyIcon1.Text = "AutoTask"<br />
        Me.NotifyIcon1.Visible = True<br />
        '<br />
        'STBInfo<br />
        '<br />
        Me.STBInfo.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _<br />
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)<br />
        Me.STBInfo.Dock = System.Windows.Forms.DockStyle.None<br />
        Me.STBInfo.Enabled = False<br />
        Me.STBInfo.Location = New System.Drawing.Point(0, 232)<br />
        Me.STBInfo.Name = "STBInfo"<br />
        Me.STBInfo.Panels.AddRange(New System.Windows.Forms.StatusBarPanel() {Me.PnlRunTime, Me.PnlRoundTimes, Me.PnlPlugIns})<br />
        Me.STBInfo.ShowPanels = True<br />
        Me.STBInfo.Size = New System.Drawing.Size(696, 22)<br />
        Me.STBInfo.TabIndex = 1<br />
        Me.STBInfo.Text = "StatusBar1"<br />
        '<br />
        'PnlRunTime<br />
        '<br />
        Me.PnlRunTime.Alignment = System.Windows.Forms.HorizontalAlignment.Center<br />
        Me.PnlRunTime.Icon = CType(resources.GetObject("PnlRunTime.Icon"), System.Drawing.Icon)<br />
        Me.PnlRunTime.Text = "0D 0H 0M"<br />
        Me.PnlRunTime.Width = 90<br />
        '<br />
        'PnlRoundTimes<br />
        '<br />
        Me.PnlRoundTimes.Alignment = System.Windows.Forms.HorizontalAlignment.Center<br />
        Me.PnlRoundTimes.Icon = CType(resources.GetObject("PnlRoundTimes.Icon"), System.Drawing.Icon)<br />
        Me.PnlRoundTimes.Text = "0"<br />
        Me.PnlRoundTimes.Width = 80<br />
        '<br />
        'PnlPlugIns<br />
        '<br />
        Me.PnlPlugIns.Icon = CType(resources.GetObject("PnlPlugIns.Icon"), System.Drawing.Icon)<br />
        Me.PnlPlugIns.MinWidth = 1<br />
        Me.PnlPlugIns.Width = 510<br />
        '<br />
        'Form1<br />
        '<br />
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)<br />
        Me.ClientSize = New System.Drawing.Size(696, 254)<br />
        Me.Controls.Add(Me.STBInfo)<br />
        Me.Controls.Add(Me.TabControl1)<br />
        Me.Controls.Add(Me.TxtMain)<br />
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)<br />
        Me.MaximizeBox = False<br />
        Me.MinimizeBox = False<br />
        Me.Name = "Form1"<br />
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen<br />
        Me.Text = "AutoTask"<br />
        Me.TabControl1.ResumeLayout(False)<br />
        CType(Me.PnlRunTime, System.ComponentModel.ISupportInitialize).EndInit()<br />
        CType(Me.PnlRoundTimes, System.ComponentModel.ISupportInitialize).EndInit()<br />
        CType(Me.PnlPlugIns, System.ComponentModel.ISupportInitialize).EndInit()<br />
        Me.ResumeLayout(False)<br />
<br />
    End Sub<br />
<br />
#End Region<br />
<br />
    Private Sub TimerProc(ByVal state As Object)<br />
        Tmr.Change(Threading.Timeout.Infinite, Threading.Timeout.Infinite)<br />
        ....<br />
        Tmr.Change(10000, 10000)<br />
    End Sub<br />
<br />
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        Tcb = New Threading.TimerCallback(AddressOf TimerProc)<br />
        Tmr = New Threading.Timer(Tcb, vbNull, 1000, 10000)<br />
        Me.NotifyIcon1.Visible = True<br />
        Me.WindowState = FormWindowState.Minimized<br />
        Me.ShowInTaskbar = False<br />
        LogMain("Program Start at:" & PathString)<br />
    End Sub<br />
<br />
    Private Sub LogMain(ByVal S As String)<br />
        Me.TxtMain.Text = Now & ": " & S & vbCrLf & Me.TxtMain.Text<br />
    End Sub<br />
<br />
    Private Sub TabControl1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabControl1.SelectedIndexChanged<br />
        Dim t As TextBox<br />
        For Each t2 As Object In Me.Controls<br />
            If Equals(t2.GetType, GetType(TextBox)) Then<br />
                t = CType(t2, TextBox)<br />
                If t.Name <> "Txt" & Me.TabControl1.SelectedTab.Tag Then<br />
                    t.Visible = False<br />
                Else<br />
                    t.Visible = True<br />
                End If<br />
            End If<br />
        Next<br />
    End Sub<br />
<br />
    Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing<br />
        e.Cancel = True<br />
        Me.WindowState = FormWindowState.Minimized<br />
        Me.ShowInTaskbar = False<br />
        Me.NotifyIcon1.Visible = True<br />
    End Sub<br />
<br />
    Private Sub EndProgram_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles EndProgram.Click<br />
        If Not PL Is Nothing Then<br />
            For i As Integer = 0 To PL.GetUpperBound(0)<br />
                PL(i).Ins.EndNow()<br />
            Next<br />
        End If<br />
        Me.NotifyIcon1.Visible = False<br />
        Tmr.Change(Threading.Timeout.Infinite, Threading.Timeout.Infinite)<br />
        Tmr.Dispose()<br />
        End<br />
    End Sub<br />
<br />
    Private Sub NotifyIcon1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles NotifyIcon1.DoubleClick<br />
        ShowMain_Click(sender, e)<br />
    End Sub<br />
<br />
    Private Sub ShowMain_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ShowMain.Click<br />
        Me.WindowState = FormWindowState.Normal<br />
        Me.ShowInTaskbar = True<br />
        Me.NotifyIcon1.Visible = False<br />
    End Sub<br />
<br />
    Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize<br />
        If Me.STBInfo.Width > 300 Then Me.STBInfo.Panels(2).Width = Me.STBInfo.Width - Me.STBInfo.Panels(0).Width - Me.STBInfo.Panels(1).Width<br />
    End Sub<br />
End Class

GeneralRe: why my timer control(or threading.timer) not run under win2003? Pin
Steve Pullan8-Sep-05 18:52
Steve Pullan8-Sep-05 18:52 
GeneralRe: why my timer control(or threading.timer) not run under win2003? Pin
woodwell8-Sep-05 19:06
woodwell8-Sep-05 19:06 
GeneralRe: why my timer control(or threading.timer) not run under win2003? Pin
Steve Pullan8-Sep-05 19:22
Steve Pullan8-Sep-05 19:22 
GeneralRe: why my timer control(or threading.timer) not run under win2003? Pin
woodwell8-Sep-05 19:59
woodwell8-Sep-05 19:59 
GeneralRe: why my timer control(or threading.timer) not run under win2003? Pin
Steve Pullan8-Sep-05 20:28
Steve Pullan8-Sep-05 20:28 
GeneralRe: why my timer control(or threading.timer) not run under win2003? Pin
woodwell8-Sep-05 20:49
woodwell8-Sep-05 20:49 
QuestionHow to scan a document using Visual Basic Pin
Candor Soft7-Sep-05 21:54
Candor Soft7-Sep-05 21:54 
QuestionMScomm control in VB6 Pin
brownboy7-Sep-05 19:20
brownboy7-Sep-05 19:20 
QuestionCINT Pin
tatchung7-Sep-05 18:29
tatchung7-Sep-05 18:29 
AnswerRe: CINT Pin
Christian Graus7-Sep-05 19:00
protectorChristian Graus7-Sep-05 19:00 
GeneralRe: CINT Pin
tatchung7-Sep-05 19:50
tatchung7-Sep-05 19:50 
GeneralRe: CINT Pin
Christian Graus7-Sep-05 19:59
protectorChristian Graus7-Sep-05 19:59 
GeneralRe: CINT Pin
tatchung7-Sep-05 20:04
tatchung7-Sep-05 20:04 
GeneralRe: CINT Pin
Dave Kreskowiak8-Sep-05 1:56
mveDave Kreskowiak8-Sep-05 1:56 
Answer[Message Deleted] Pin
Steve Pullan7-Sep-05 19:05
Steve Pullan7-Sep-05 19:05 
QuestionChange Font map on windows Pin
dmtuan7-Sep-05 17:15
dmtuan7-Sep-05 17:15 
QuestionRichTextBox FontStyles Pin
Taen_Karth7-Sep-05 15:23
Taen_Karth7-Sep-05 15:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.