Handle Keyword?
-
hi, i am confused with Handle Keyword. what is this "Handle" key word?? why we need this? i saw this sample code in microsoft core references VB.Net Book. it is referenced to Accessing the user control from the client Page: Proteced WithEvents pbar As PagingBar Private Sub Page_load(ByVal sender As object, ByVal e As EventArgs)_ Handles MyBase.Load pbar=Directcast(findcontrol("PagingBar1").PageingBar) End Sub please can anyone tell me what is "Handle" keyword?? Thanks, Rahi
If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
hi, i am confused with Handle Keyword. what is this "Handle" key word?? why we need this? i saw this sample code in microsoft core references VB.Net Book. it is referenced to Accessing the user control from the client Page: Proteced WithEvents pbar As PagingBar Private Sub Page_load(ByVal sender As object, ByVal e As EventArgs)_ Handles MyBase.Load pbar=Directcast(findcontrol("PagingBar1").PageingBar) End Sub please can anyone tell me what is "Handle" keyword?? Thanks, Rahi
If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
You can add events after the handles keyword, which allows that procedure to handle a particular event . For instance if I had a procedure that I wanted to handle the click event for a number of buttons I could add each buttons click event after the handles keyword.
-
You can add events after the handles keyword, which allows that procedure to handle a particular event . For instance if I had a procedure that I wanted to handle the click event for a number of buttons I could add each buttons click event after the handles keyword.
hi, thanks for answering my question! i have one samll doubt....is it compulsory to use with withevent keyword to handle the event handler?? Thanks, Rahi
If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
hi, thanks for answering my question! i have one samll doubt....is it compulsory to use with withevent keyword to handle the event handler?? Thanks, Rahi
If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
I'm not sure I understand the question. I don't think 'Withevents' is required in any circumstances. You can use it when you declare a variable. Like 'Withevents txt as new textbox'. This really just makes it easier to add an event handler for your object because you can select the event just like you would for any textbox you put on your form in the designer. However, you can always write an event handler even if you didn't use 'Withevents'. I hope that made some sense to you.