Click here to Skip to main content
16,004,887 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: event Pin
progload12-Feb-06 7:34
progload12-Feb-06 7:34 
AnswerRe: event Pin
Dave Kreskowiak12-Feb-06 13:12
mveDave Kreskowiak12-Feb-06 13:12 
AnswerRe: event Pin
Roy Heil13-Feb-06 10:07
professionalRoy Heil13-Feb-06 10:07 
QuestionLearning resources - from a C#/VB6 background Pin
AJ12312-Feb-06 2:13
AJ12312-Feb-06 2:13 
AnswerRe: Learning resources - from a C#/VB6 background Pin
Joshua Quick12-Feb-06 10:08
Joshua Quick12-Feb-06 10:08 
QuestionSTRANGE Object reference not set to an instance of an object Pin
blucas200511-Feb-06 23:02
blucas200511-Feb-06 23:02 
AnswerRe: STRANGE Object reference not set to an instance of an object Pin
Colin Angus Mackay12-Feb-06 2:01
Colin Angus Mackay12-Feb-06 2:01 
Questiondelegate event raise on winforms Pin
blucas200511-Feb-06 22:22
blucas200511-Feb-06 22:22 
Hi, I'm trying to create the following scenarion

You have 2 winforms A and B

A has a Sub that will pop a msgbox("oi")
and a button that pops form b

forms b has a button that raise a event on A and run the sub with the msgbox

i tried the code bellow, it worked in a console version, but is not working when in a winform

could you help me?

code bellow:



''''FIRST CLASS


Public Class CClock

Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

mobjTimer = New CTimer

AddHandler mobjTimer.evtMinute, AddressOf MinuteEvent

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

'Add any initialization after the InitializeComponent() call

End Sub

Private Sub MinuteEvent(ByVal xintTime As String)
TextBox1.Text = "crap"
MsgBox("Minute's Event")
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 Button1 As System.Windows.Forms.Button
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox

End Region

Private WithEvents mobjTimer As CTimer

Private Sub CClock_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim xx As New CTimer
xx.Show()
End Sub
End Class


''''SECOND CLASS

Public Class CTimer
Inherits System.Windows.Forms.Form


''delegate
Delegate Sub SecondDel(ByVal xintTime As String)
'''delegate instance
Private evtSecond As SecondDel
''delegate

'''EVENTS
Public Event evtMinute As SecondDel





#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 Button1 As System.Windows.Forms.Button


End Region

Private Sub CTimer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
RaiseEvent evtMinute("lngSeconds")
End Sub
End Class
AnswerRe: delegate event raise on winforms Pin
Joshua Quick12-Feb-06 9:45
Joshua Quick12-Feb-06 9:45 
QuestionMutliple Colored ProgressBar Pin
suchiate11-Feb-06 20:49
suchiate11-Feb-06 20:49 
AnswerRe: Mutliple Colored ProgressBar Pin
Dave Kreskowiak12-Feb-06 2:33
mveDave Kreskowiak12-Feb-06 2:33 
GeneralRe: Mutliple Colored ProgressBar Pin
suchiate12-Feb-06 2:38
suchiate12-Feb-06 2:38 
GeneralRe: Mutliple Colored ProgressBar Pin
Dave Kreskowiak12-Feb-06 3:06
mveDave Kreskowiak12-Feb-06 3:06 
GeneralRe: Mutliple Colored ProgressBar Pin
suchiate12-Feb-06 3:09
suchiate12-Feb-06 3:09 
QuestionSending Email with Free Webmail Servers Pin
ThePmanLives11-Feb-06 19:18
ThePmanLives11-Feb-06 19:18 
AnswerRe: Sending Email with Free Webmail Servers Pin
Dave Kreskowiak12-Feb-06 2:30
mveDave Kreskowiak12-Feb-06 2:30 
GeneralRe: Sending Email with Free Webmail Servers Pin
ThePmanLives12-Feb-06 8:39
ThePmanLives12-Feb-06 8:39 
GeneralRe: Sending Email with Free Webmail Servers Pin
Dave Kreskowiak12-Feb-06 13:01
mveDave Kreskowiak12-Feb-06 13:01 
GeneralRe: Sending Email with Free Webmail Servers Pin
ThePmanLives12-Feb-06 13:42
ThePmanLives12-Feb-06 13:42 
GeneralRe: Sending Email with Free Webmail Servers Pin
Dave Kreskowiak12-Feb-06 14:08
mveDave Kreskowiak12-Feb-06 14:08 
QuestionHow to connect SQL with VB.NET Pin
umairqayyum11-Feb-06 19:09
umairqayyum11-Feb-06 19:09 
AnswerRe: How to connect SQL with VB.NET Pin
Colin Angus Mackay12-Feb-06 2:03
Colin Angus Mackay12-Feb-06 2:03 
QuestionPrinter.CurrentY question? Pin
bolson5011-Feb-06 17:41
bolson5011-Feb-06 17:41 
AnswerRe: Printer.CurrentY question? Pin
Dave Kreskowiak12-Feb-06 2:27
mveDave Kreskowiak12-Feb-06 2:27 
GeneralRe: Printer.CurrentY question? Pin
bolson5012-Feb-06 9:41
bolson5012-Feb-06 9:41 

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.