Click here to Skip to main content
15,890,527 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Date Pin
Guffa6-Mar-07 0:58
Guffa6-Mar-07 0:58 
QuestionVB .NET Updating Outlook Records Pin
George B Gilbert5-Mar-07 18:20
George B Gilbert5-Mar-07 18:20 
AnswerRe: VB .NET Updating Outlook Records Pin
Johan Hakkesteegt6-Mar-07 2:25
Johan Hakkesteegt6-Mar-07 2:25 
Questionissue in saving an xml Pin
ArchaBhandare5-Mar-07 17:39
ArchaBhandare5-Mar-07 17:39 
AnswerRe: issue in saving an xml Pin
Dave Kreskowiak6-Mar-07 2:36
mveDave Kreskowiak6-Mar-07 2:36 
GeneralRe: issue in saving an xml Pin
ArchaBhandare6-Mar-07 19:54
ArchaBhandare6-Mar-07 19:54 
QuestionEventhandler on custom control Pin
Jodd5-Mar-07 16:04
Jodd5-Mar-07 16:04 
AnswerRe: Eventhandler on custom control Pin
TwoFaced5-Mar-07 18:37
TwoFaced5-Mar-07 18:37 
You can add event handlers at runtime by using AddHandler. For example lets say I create a button at runtime, this would be the code to link the buttons click event with a given method.
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim btn As New Button
        Me.Controls.Add(btn)
        AddHandler btn.Click, AddressOf RuntimeButton_Click
    End Sub

    Private Sub RuntimeButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        MsgBox("You clicked a button added at runtime")
    End Sub
End Class
Your custom control is no different. It's a control just like a button. Just create a method that excepts the same parameters as your event. Then use AddHandler to link each control you make with that method.

Also, all .net events have a sender object and 'e' which is or inherits from system.eventargs. I would recomend for consistency staying with that pattern. You can read more about creating your own events here[^].
GeneralRe: Eventhandler on custom control Pin
Jodd6-Mar-07 2:28
Jodd6-Mar-07 2:28 
QuestionVB.NET INSTALLER Pin
7prince5-Mar-07 15:48
7prince5-Mar-07 15:48 
AnswerRe: VB.NET INSTALLER Pin
jack_claudine5-Mar-07 21:59
jack_claudine5-Mar-07 21:59 
AnswerRe: VB.NET INSTALLER Pin
Dave Kreskowiak6-Mar-07 2:32
mveDave Kreskowiak6-Mar-07 2:32 
QuestionChanging MSHFlexGrid so it doesn't select the first non-fixed row when clicking in a fixed row Pin
Barry True5-Mar-07 13:50
Barry True5-Mar-07 13:50 
QuestionUNC path to the application problem Pin
alexfromto5-Mar-07 12:03
alexfromto5-Mar-07 12:03 
AnswerRe: UNC path to the application problem Pin
Dave Kreskowiak6-Mar-07 2:30
mveDave Kreskowiak6-Mar-07 2:30 
GeneralRe: UNC path to the application problem Pin
alexfromto6-Mar-07 3:00
alexfromto6-Mar-07 3:00 
Questionlistview image change exsiting Pin
FeRtoll5-Mar-07 11:37
FeRtoll5-Mar-07 11:37 
AnswerRe: listview image change exsiting Pin
FeRtoll5-Mar-07 20:30
FeRtoll5-Mar-07 20:30 
GeneralRe: listview image change exsiting Pin
jack_claudine5-Mar-07 22:06
jack_claudine5-Mar-07 22:06 
QuestionCreating "virtual pages" Pin
grantg5-Mar-07 9:57
grantg5-Mar-07 9:57 
AnswerRe: Creating "virtual pages" Pin
Dave Kreskowiak5-Mar-07 14:00
mveDave Kreskowiak5-Mar-07 14:00 
Questionvb.net class Pin
Lorenzo5-Mar-07 9:55
Lorenzo5-Mar-07 9:55 
AnswerRe: vb.net class Pin
Colin Angus Mackay5-Mar-07 13:58
Colin Angus Mackay5-Mar-07 13:58 
GeneralRe: vb.net class Pin
Colin Angus Mackay5-Mar-07 20:29
Colin Angus Mackay5-Mar-07 20:29 
Questionreading from a multiline textbox Pin
irfan_mohsin5-Mar-07 9:03
irfan_mohsin5-Mar-07 9:03 

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.