Click here to Skip to main content
15,898,134 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Why this expression produce error Pin
ZurdoDev13-Jan-15 4:32
professionalZurdoDev13-Jan-15 4:32 
GeneralRe: Why this expression produce error Pin
dilkonika13-Jan-15 5:00
dilkonika13-Jan-15 5:00 
QuestionHow to implement the Bernstein crc ? Pin
SepPax8-Jan-15 13:09
SepPax8-Jan-15 13:09 
QuestionGet messages sent to external ComboBox Pin
ezio20007-Jan-15 5:40
ezio20007-Jan-15 5:40 
AnswerRe: Get messages sent to external ComboBox Pin
Richard Andrew x647-Jan-15 17:23
professionalRichard Andrew x647-Jan-15 17:23 
QuestionTrying to understand the nature of inherited windows forms.... Pin
Sam Marrocco7-Jan-15 5:26
Sam Marrocco7-Jan-15 5:26 
AnswerRe: Trying to understand the nature of inherited windows forms.... Pin
Eddy Vluggen7-Jan-15 5:56
professionalEddy Vluggen7-Jan-15 5:56 
AnswerRe: Trying to understand the nature of inherited windows forms.... Pin
bojammis7-Jan-15 15:15
professionalbojammis7-Jan-15 15:15 
Remove any functioning code from the constructors.

Public Class myForm
    Inherits Form
    WithEvents _tmr As System.Timers.Timer
    Dim _lbDateTime As Label

    Public Sub New()
    End Sub
    Public Sub StartUI()
        _tmr = New System.Timers.Timer
        _tmr.Interval = 2000
        _lbDateTime = New Label
        Controls.Add(_lbDateTime)
        _lbDateTime.Location = New Point(5, 5)
        _lbDateTime.Visible = True
        _lbDateTime.AutoSize = True
        _tmr.Start()
    End Sub
    Private Sub Tick() Handles _tmr.Elapsed
        _tmr.Stop()
        UpdateTimer(Date.Now)
        _tmr.Start()
    End Sub
    Private Sub UpdateTimer(ByVal time As String)
        If _lbDateTime.InvokeRequired Then
            _lbDateTime.Invoke(New Action(Of String)(AddressOf UpdateTimer), time)
        End If
        _lbDateTime.Text = Date.Now
    End Sub
End Class


In the Child form's constructor add the call to StartUI()

VB
Public Sub New()

    ' This call is required by the designer.
    InitializeComponent()
    ' Add any initialization after the InitializeComponent() call.
    StartUI()
End Sub


regs

ron O.
GeneralRe: Trying to understand the nature of inherited windows forms.... Pin
Sam Marrocco8-Jan-15 2:54
Sam Marrocco8-Jan-15 2:54 
GeneralRe: Trying to understand the nature of inherited windows forms.... Pin
bojammis8-Jan-15 5:47
professionalbojammis8-Jan-15 5:47 
QuestionOutlook...vba to assign a UDF a value (attachment.filenames) Pin
Member 113499046-Jan-15 16:00
Member 113499046-Jan-15 16:00 
QuestionNew computer language creation using visual basic Pin
Member 113553585-Jan-15 22:50
Member 113553585-Jan-15 22:50 
QuestionHMAC Calculating for Request Header Pin
jkirkerx4-Jan-15 10:18
professionaljkirkerx4-Jan-15 10:18 
GeneralLost in translation? Pin
jkirkerx5-Jan-15 10:57
professionaljkirkerx5-Jan-15 10:57 
Answer[SOLVED] Pin
jkirkerx5-Jan-15 12:34
professionaljkirkerx5-Jan-15 12:34 
GeneralRe: [SOLVED] Pin
Member 149534685-Aug-21 5:50
Member 149534685-Aug-21 5:50 
GeneralRe: [SOLVED] Pin
jkirkerx5-Aug-21 6:22
professionaljkirkerx5-Aug-21 6:22 
QuestionHow to make a youtube downloader in vb.net Pin
Anupama Rhiyas1-Jan-15 21:41
Anupama Rhiyas1-Jan-15 21:41 
AnswerRe: How to make a youtube downloader in vb.net Pin
Richard MacCutchan1-Jan-15 22:30
mveRichard MacCutchan1-Jan-15 22:30 
AnswerRe: How to make a youtube downloader in vb.net Pin
Simon_Whale1-Jan-15 22:46
Simon_Whale1-Jan-15 22:46 
QuestionVB 2013 Community (Transparent Text Control) Pin
peskykid821-Jan-15 15:17
professionalpeskykid821-Jan-15 15:17 
GeneralRe: VB 2013 Community (Transparent Text Control) Pin
PIEBALDconsult1-Jan-15 15:48
mvePIEBALDconsult1-Jan-15 15:48 
AnswerRe: VB 2013 Community (Transparent Text Control) Pin
Eddy Vluggen5-Jan-15 7:17
professionalEddy Vluggen5-Jan-15 7:17 
Questionann Pin
Member 1134553331-Dec-14 8:32
Member 1134553331-Dec-14 8:32 
AnswerRe: ann Pin
Dave Kreskowiak31-Dec-14 15:46
mveDave Kreskowiak31-Dec-14 15:46 

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.