473,386 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How Set A Class Property To True - AddHandler - Button Click ?

4
Vb.net – VStudio 2010 – Win 7

FORM Class Project Named ‘Notify’
With Reference to ZonesLib - Successful Build

Expand|Select|Wrap|Line Numbers
  1.  
  2. Public Class Alarms
  3.  
  4. Private Sub myAlarms_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load     
  5. End Sub
  6.  
  7. ‘In code just below am trying to Set iSkip Property in ZonesLib.TimerProc to True using AddHandler event
  8. ‘The code runs but nothing happens… missing args?? something stupidly simple in my AddHandler code or event handler code ??
  9.  
  10. Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
  11.    AddHandler Button1.Click, AddressOf ZonesLib.TimerProc.SetSkip
  12.    Me.Close()
  13. End Sub
  14.  
  15. End Class
  16.  
  17.  

Standard Class Project Named ‘ZonesLib’ - Successful Build

Expand|Select|Wrap|Line Numbers
  1.  
  2. Public Class TimerProc
  3.  
  4.      Public Shared Sub SetSkip(sender As System.Object, e As System.EventArgs)
  5.          iSkip = True
  6.          MsgBox("Skip")
  7.     End Sub
  8.  
  9.     Private Shared _iSkip As Boolean = False
  10.     Public Shared Property iSkip() As Boolean
  11.         Get
  12.             iSkip = _iSkip
  13.         End Get
  14.         Set(ByVal value As Boolean)
  15.             _iSkip = value
  16.         End Set
  17.     End Property
  18.  
  19. End Class
  20.  
  21.  
Attached Files
File Type: docx AddHandlerSyntaxQuestionInWordFormat.docx (15.2 KB, 362 views)
Mar 18 '15 #1

✓ answered by CJames

OK... Doh !!...

I moved the AddHandler line of code to handle the Button1.click event into the form's Load event instead of having it in its own Button1.click Sub with an immediate Me.Close line of code...

Since how could an addhandler 'listen' for a click event with the Form already closed...

Works fine Now... Move along... nothin' to see or learn here.

:o)

CJ

1 1375
CJames
4
OK... Doh !!...

I moved the AddHandler line of code to handle the Button1.click event into the form's Load event instead of having it in its own Button1.click Sub with an immediate Me.Close line of code...

Since how could an addhandler 'listen' for a click event with the Form already closed...

Works fine Now... Move along... nothin' to see or learn here.

:o)

CJ
Mar 19 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: wendy | last post by:
I created com add-in for word2003, excel2003 and powerpoint2003, basically, i added 4 button in toobar and on_click, i apply some bussiness logic. all works in excel2003 and powerpoint 2003, but in...
4
by: Mark Lingen | last post by:
I've found a problem with postback event handling and webcontrol buttons. Try out the following code in an ASP.Net project and you will see. Create a web project in VB.Net and drop this code...
1
by: Martin | last post by:
Hi, I have produced a custom server control that simple outputs a row of 26 buttons, one button for each letter of the english alphabet. now what I would like to do is catch the button click...
3
by: Imran Aziz | last post by:
Hello All, I have a search text and button that post data and my button handler filters the repeater control. However when the button is clicked the first time. The page_load event is being called...
11
by: Sarah | last post by:
I have code that I want to run so that if the result is true, it changes the current button's ".DialogResult" property to "DialogResult.OK". Problem is, when I run this code on the ".Click" event...
0
by: TCook | last post by:
Hey All, I'm trapping a 'submit' button's 'Click' event in a VB.Net code behind class in order to loop through a 'Select' controls 'option' list as follows: For Each ThisItem In...
1
by: shapper | last post by:
Hello, I am creating a custom control where I have a button. Somehow my button click event is not being raised. I tried to place different codes inside MyButton_Click and nothing runs. Then I...
1
by: RSH | last post by:
Hi, I have a situation where I have a user Control (ResultHeader.ascx) that has a button. I am placing that control into a page (samplePage.aspx). I have setup a custom event, that should from...
7
by: =?Utf-8?B?bWFydGluMQ==?= | last post by:
Hi, All, I create button in the code ( Dim Button as new Button), not using button web component (means not drap button and drop it ont he webform), after that I try to use button_click event,...
19
Frinavale
by: Frinavale | last post by:
I'm in the middle of implementing a custom Ajax enabled Server Control. At this point I need help finding the answer to an Ajax Framework question...here it goes: I have a Server Control that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.