473,406 Members | 2,705 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,406 software developers and data experts.

Unable to use Property instead of Sub in Thread

The code below appears in my thread code.

I'm unable to use WriteOnly Property because of signature unmatch.

WriteOnly Property ButtonAbortFolderVisible() As Boolean' does not have the
same signature as delegate 'Delegate Sub SetBooleanCallback(value As
Boolean)

Is there any way around that?

Thanks

Public Sub ButtonAbortFolderVisible(ByVal value As Boolean)

If mFormForAbort.ButtonAbortFolder.InvokeRequired Then

Dim d As New SetBooleanCallback(AddressOf ButtonAbortFolderVisible)

mFormForAbort.ButtonAbortFolder.Invoke(d, New Object() {value})

Else

mFormForAbort.ButtonAbortFolder.Visible = value

snip...

End If

End If

End Sub
Apr 1 '06 #1
3 1015
Allen wrote:
<snip>
I'm unable to use WriteOnly Property because of signature unmatch.

WriteOnly Property ButtonAbortFolderVisible() As Boolean' does not have the
same signature as delegate 'Delegate Sub SetBooleanCallback(value As
Boolean)

Is there any way around that?

<snip>

Unfortunately, nope. It seems to me that a Delegate can only be a
Function or a Sub.

If you want to expose a Property, then you may make it 'delegate' to
the actual method that aborts the folder:

Public WriteOnly Property ButtonAbortFolderVisible() As Boolean
Set(Value As Boolean)
DoAbortFolderVisible(Value)
End Set
End Property

Regards,

Branco.

Apr 1 '06 #2
thanks for the info
"Branco Medeiros" <br*************@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Allen wrote:
<snip>
I'm unable to use WriteOnly Property because of signature unmatch.

WriteOnly Property ButtonAbortFolderVisible() As Boolean' does not have
the
same signature as delegate 'Delegate Sub SetBooleanCallback(value As
Boolean)

Is there any way around that?

<snip>

Unfortunately, nope. It seems to me that a Delegate can only be a
Function or a Sub.

If you want to expose a Property, then you may make it 'delegate' to
the actual method that aborts the folder:

Public WriteOnly Property ButtonAbortFolderVisible() As Boolean
Set(Value As Boolean)
DoAbortFolderVisible(Value)
End Set
End Property

Regards,

Branco.

Apr 1 '06 #3
Is the following correct?

SetBooleanCallback is a class (it is called a delegate only because classes
reference functions are called delegates)

from

Dim d As New SetBooleanCallback(AddressOf ButtonAbortFolderVisible)

d is an instance of that class that references ButtonAbortFolderVisible

I not sure of what I'm saying so if there is a better way to say it, it may
make it clearer.
Thanks again

"Branco Medeiros" <br*************@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Allen wrote:
<snip>
I'm unable to use WriteOnly Property because of signature unmatch.

WriteOnly Property ButtonAbortFolderVisible() As Boolean' does not have
the
same signature as delegate 'Delegate Sub SetBooleanCallback(value As
Boolean)

Is there any way around that?

<snip>

Unfortunately, nope. It seems to me that a Delegate can only be a
Function or a Sub.

If you want to expose a Property, then you may make it 'delegate' to
the actual method that aborts the folder:

Public WriteOnly Property ButtonAbortFolderVisible() As Boolean
Set(Value As Boolean)
DoAbortFolderVisible(Value)
End Set
End Property

Regards,

Branco.

Apr 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mike Dole | last post by:
I'm working on a client - server application based on the 'How to Sockets Server and How to Sockets Client' code from the Visual Basic ..NET Resource Kit. Since I want to be able to send 'big...
10
by: Chris Simon | last post by:
A bit puzzled by this... 1. Ask the validator to look at http://www.nantperis.org.uk/index.php.en (the exact filename of the page) and it brings back an error: 300 Multiple Choices. I could...
2
by: cresswell | last post by:
I keep on changing it from '' o '', but it reverts to when I save the table design. Seems like if I'm in Access 2003 with DbFormat=Access 2000, I cannot change that property. True?
12
by: MuZZy | last post by:
Hi, Sorry for a repeated post but i didn't receive an answer and will try to re-phrase my question: How do i close an additional thread from the main thread, if this additional thread is stuck...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
1
by: A Traveler | last post by:
Hello, i am having this problem. The exact error message is: "Unable to generate code for a value of type 'System.Web.UI.Page'. This error occurred while trying to generate the property value for...
0
by: bazzer | last post by:
hey, i am using visual basic.net 2003 and have an ASP.NET webform application thats accessing a microsoft access 2003 database. i kept getting the following error when i tried to run it: ERROR ...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
9
by: Jim in Arizona | last post by:
I get this error: Unable to cast object of type 'System.Web.UI.HtmlControls.HtmlInputText' to type 'System.Web.UI.WebControls.TextBox'. Using this code: Dim test3 As TextBox test3 =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.