Results 1 to 6 of 6
  1. #1

    Default Help with events in VB.NET


    Lets say I wanna have this function activate everytime any button in a form is clicked. Help me plz

  2. #2

    Default Re: Help with events in VB.NET

    assuming you have Button1 and Button 2 defined and you want them to have the same EventHandler

    Code:
      Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click, Button1.Click
        MsgBox("test")
      End Sub

  3. #3

    Default Re: Help with events in VB.NET

    Hi mga bai, ask ta ko unsa equivalent ani sa C#? Thanks...

  4. #4

    Default Re: Help with events in VB.NET

    hi bro, if your using MS VS 2005 you can press the "thunder" icon on the object property window then double click the
    click event ms should make the handler automatically..

    something like

    Code:
        private void button1_Click(object sender, EventArgs e)
        {
           // Do your methods
        }
    or you can do something like..

    Code:
         public void initializeControlstuff()
         {
              button1.Click+=new EventHandler(myEventHandler);
              ....
              ....
         }
    
        private void myEventHandler(object sender, EventArgs e)
        {
           // Do your do you stuff
        }

  5. #5

    Default Re: Help with events in VB.NET


  6. #6

    Default Re: Help with events in VB.NET

    Thankz bai..

  7.    Advertisement

Similar Threads

 
  1. Replies: 28
    Last Post: 01-02-2013, 07:46 PM
  2. Help in VB.net to Oracle 10g..
    By scioncray in forum Programming
    Replies: 5
    Last Post: 10-01-2008, 05:59 PM
  3. Whats the event for minimizing in vb.net?
    By DeathFox in forum Programming
    Replies: 3
    Last Post: 02-12-2008, 12:21 PM
  4. MOVED: Harcoding or Drag'n'Drop in VB.NET
    By vern in forum Software & Games (Old)
    Replies: 0
    Last Post: 11-10-2007, 02:27 PM
  5. Harcoding or Drag'n'Drop in VB.NET
    By DeathFox in forum Programming
    Replies: 2
    Last Post: 11-09-2007, 09:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top