Passing System.EventArgs as parameters

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi everyone,

I've been using VB.NET for about 6 weeks now and I keep stumbling on a
concept that I hope someone can clear up for me. Each event of a
control has 2 parameters, sender and e....I am not understanding what
the purpose of those parameters are. Can someone clear that up?

Along those lines, I also don't understand how to make a call to a
Click event...what are you supposed to pass in?

In a program that I am working on I need to draw a border around a
panel. I did some research and found some code that will do just that
(sorry if it pastes ugly):

Private Sub PaintBorder(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs)
ControlPaint.DrawBorder(e.Graphics, e.ClipRectangle,
Color.Black, 3, ButtonBorderStyle.Solid, Color.Black, 3,
ButtonBorderStyle.Solid, Color.Black, 3, ButtonBorderStyle.Solid,
Color.Black, 3, ButtonBorderStyle.Solid)
End Sub

How would I call this function if I wanted to paint a border on a panel
called Panel1???

Thank you in advance for any help!

.



Relevant Pages

  • Problem with a Calendar control
    ... Private Sub btnEvent_Click(ByVal sender As System.Object, ... On each of these panels there are buttons that link to a calendar ... This functionality works well on the first visible panel on the page ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Event firing twice in UserControl issue
    ... fire twice. ... with no panel) with a panel then a custom ListControl. ... Private Sub radiobuttonlist1_selectedvaluechanged(ByVal sender As Object, ... Private Sub RadioPanel1_SelectedValueChanged(ByVal sender As Object, ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Inherit Control SelectAll() not working
    ... I've modified the standard text box to change the background color on ... border during edit. ... Private Sub SssiTextBox_Enter(ByVal sender As Object, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Moving toolbox
    ... I made a toolbox like thing by using a panel with a label docked on top. ... Private Sub Label1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown ...
    (microsoft.public.dotnet.languages.vb)
  • Re: reusing sub routines
    ... For example you can use the sender to change the background color of the ... panel when you are dragging over that panel, ... > how can I make one subroutine to handle events from different objects? ... > Private Sub Panel1_DragEnter(ByVal sender As Object, ...
    (microsoft.public.dotnet.languages.vb)