Click here to Skip to main content
15,912,400 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Database NULL values Pin
Ian Darling30-Sep-03 5:41
Ian Darling30-Sep-03 5:41 
Generalrow selection in flexgrid Pin
Giwan29-Sep-03 4:49
sussGiwan29-Sep-03 4:49 
GeneralCalling unmanaged dll from VB .NET Pin
Asad Hussain29-Sep-03 4:20
Asad Hussain29-Sep-03 4:20 
Generalsearch db and display Pin
Inneedofluv28-Sep-03 17:55
Inneedofluv28-Sep-03 17:55 
GeneralUPGRADE_WARNING message removal Pin
JimWDurbin27-Sep-03 10:43
JimWDurbin27-Sep-03 10:43 
GeneralSocket programming problem Pin
Asad Hussain27-Sep-03 9:22
Asad Hussain27-Sep-03 9:22 
GeneralRe: Socket programming problem Pin
mikasa27-Sep-03 10:01
mikasa27-Sep-03 10:01 
QuestionUrgent and Interesting!!! EventHandling Bug!!!???? Pin
Yurcus27-Sep-03 3:25
Yurcus27-Sep-03 3:25 
I have an object that fires an event and a form that handles that event. When handling the event i show a new form but the new form hangs. It gets "Loaded", "VisibleChanged" and "Activated" events and hangs. I am attaching vb code as an example.
Please see and if you can figure out why it is so i will really appreciate if you tell me.
Thanks in advance!!!!

P.S. as I understand its a bug - the form must show without problems!!!

here is the sample code of the error in vb.netSmile | :) ))

'Class EventRaiser raises SomeEvent 3 seconds after it is loaded.
'EventHandlerForm handles that event and shows modeless form.
'Normally the new form must have no problems but actually it
'receives "Load", "VisibleChanged" and "Activated" events and hangs.


'Raises event "SomeEvent" 3 seconds after it is created.
Public Class EventRaiser
Public Event SomeEvent()
Private WithEvents myTimer As New System.Timers.Timer()
Sub New()
myTimer.Interval = 3000
myTimer.Start()
End Sub


Private Sub mytimer_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles myTimer.Elapsed
RaiseEvent SomeEvent()
myTimer.Enabled = False
End Sub
End Class

Public Class EventHandlerForm
Inherits System.Windows.Forms.Form

'EventRaiser raises SomeEvent 3 seconds after it is created.
Private WithEvents myEventRaiser As New EventRaiser()


#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads 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

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(16, 16)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(320, 32)
Me.Label1.TabIndex = 0
Me.Label1.Text = "New Form is shown after 3 seconds. After it is show it hangs."
'
'EventHandlerForm
'
Me.AutoScale = False
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(344, 53)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label1})
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)

End Sub

#End Region

'In the myEventRaiser.SomeEvent handler a new form is shown modeless.
'New form receives "Load", "VisibleChanged" and "Activated" events
'and hangs
Private Sub EventRaiser_SomeEvent() Handles myEventRaiser.SomeEvent
Dim ff As New Form()
ff.Show()
End Sub
End Class
AnswerRe: Urgent and Interesting!!! EventHandling Bug!!!???? Pin
Dave Kreskowiak27-Sep-03 4:59
mveDave Kreskowiak27-Sep-03 4:59 
AnswerRe: Urgent and Interesting!!! EventHandling Bug!!!???? Pin
mikasa27-Sep-03 10:04
mikasa27-Sep-03 10:04 
GeneralRe: Urgent and Interesting!!! EventHandling Bug!!!???? Pin
Yurcus29-Sep-03 3:51
Yurcus29-Sep-03 3:51 
GeneralRe: Urgent and Interesting!!! EventHandling Bug!!!???? Pin
mikasa29-Sep-03 3:59
mikasa29-Sep-03 3:59 
GeneralRe: Urgent and Interesting!!! EventHandling Bug!!!???? Pin
Yurcus29-Sep-03 4:41
Yurcus29-Sep-03 4:41 
QuestionHow do you use default parameters in VB functions? Pin
Abin26-Sep-03 22:20
Abin26-Sep-03 22:20 
AnswerRe: How do you use default parameters in VB functions? Pin
Ian Darling27-Sep-03 0:28
Ian Darling27-Sep-03 0:28 
GeneralRe: How do you use default parameters in VB functions? Pin
Abin27-Sep-03 0:45
Abin27-Sep-03 0:45 
GeneralRe: How do you use default parameters in VB functions? Pin
Dave Kreskowiak27-Sep-03 3:38
mveDave Kreskowiak27-Sep-03 3:38 
GeneralRe: How do you use default parameters in VB functions? Pin
Carl Mercier15-Oct-03 2:39
Carl Mercier15-Oct-03 2:39 
Generalremotely monitor Pin
jenny200326-Sep-03 18:10
jenny200326-Sep-03 18:10 
GeneralRe: remotely monitor Pin
Ian Darling26-Sep-03 21:08
Ian Darling26-Sep-03 21:08 
GeneralRe: remotely monitor Pin
jenny200326-Sep-03 22:44
jenny200326-Sep-03 22:44 
GeneralRe: remotely monitor Pin
Ian Darling27-Sep-03 0:27
Ian Darling27-Sep-03 0:27 
GeneralRe: remotely monitor Pin
jenny200327-Sep-03 14:28
jenny200327-Sep-03 14:28 
GeneralRe: remotely monitor Pin
Dave Kreskowiak27-Sep-03 3:28
mveDave Kreskowiak27-Sep-03 3:28 
Generalstart a process and capture its output Pin
codger26-Sep-03 2:00
codger26-Sep-03 2:00 

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.