473,395 Members | 1,637 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,395 software developers and data experts.

properties

Hope I word this ok. Ive created a class, which I added to my
references. In the class ther is public method called isloggedin.
when I check the objects I see 'public bool IsLoggedIn { get; }
Member of BetBetter.Betfair.BetfairWrapper'. My project compiles
fine, runs ok, as Im not requesting anything. What Id like to know is
how do I get response from 'Isloggedin' into a textbox. So far I get an
error that cannot convert type bool to system.windows.form. Am I
correct in thinking this is possible because its public.
Regads Robert

May 11 '06 #1
9 5355
Robert,

Well, you can set it manually, by setting the Text property to the value
for true or false (depending on the property value).

You can also use a data binding on the textbox, like so:

// Assume textBox is the textbox, and myInstance is your class.
textBox.Bindings.Add("Text", myInstance, "IsLoggedIn");

Basically, the first parameter specifies the property on the control you
want bound to the object. The second property is the data source, in this
case, your object instance. The third property is the property to bind to
on your instance.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<Ro********@yahoo.co.uk> wrote in message
news:11********************@u72g2000cwu.googlegrou ps.com...
Hope I word this ok. Ive created a class, which I added to my
references. In the class ther is public method called isloggedin.
when I check the objects I see 'public bool IsLoggedIn { get; }
Member of BetBetter.Betfair.BetfairWrapper'. My project compiles
fine, runs ok, as Im not requesting anything. What Id like to know is
how do I get response from 'Isloggedin' into a textbox. So far I get an
error that cannot convert type bool to system.windows.form. Am I
correct in thinking this is possible because its public.
Regads Robert

May 11 '06 #2
Hi, thankyou for your reply. I tried your suggestion and get an
Error 1 'System.Windows.Forms.TextBox' does not contain a definition
for 'Bindings'.
regards robert

May 11 '06 #3
V
Hi Robert,

Which version of the framework are you using? I am not too sure whether
the binding property is available in 1.1

Also, you could simply call the ToString() method on your Property and
assign that to the TextBox.Text property.

Regards,
Vaibhav

May 11 '06 #4
Thankyou for your reply. Im using vs2005 and i can access the
databindings in the textbox properties. Ive tried tostring but get
another error Error 1 Cannot convert method group 'ToString' to
non-delegate type 'string'. Did you intend to invoke the method?. Im at
a loss here.
Regards Robert

May 11 '06 #5

<Ro********@yahoo.co.uk> wrote...
Thankyou for your reply. Im using vs2005 and i can access the
databindings in the textbox properties. Ive tried tostring but get
another error Error 1 Cannot convert method group 'ToString' to
non-delegate type 'string'. Did you intend to invoke the method?. Im at
a loss here.


I believe that's the message you get when you try to invoke ToString() as a
property instead of as a method.

Could you have forgotten the parenthesis on ToString() ?

/// Bjorn A
May 11 '06 #6
Im now trying textBox1 = bf.IsLoggedIn.ToString(); and get
Error 1 Cannot implicitly convert type 'string' to
'System.Windows.Forms.TextBox'
Regards Robert

May 12 '06 #7
Man, go read some book, this is ridiculous, you have been solving this issue
for 2 days...

this.textBox1.Text = bf.IsLoggedIn.ToString();

and don't tell us that textBox1 does not exist in current context because
you renamed it yesterday.

<Ro********@yahoo.co.uk> wrote in message
news:11*********************@y43g2000cwc.googlegro ups.com...
Im now trying textBox1 = bf.IsLoggedIn.ToString(); and get
Error 1 Cannot implicitly convert type 'string' to
'System.Windows.Forms.TextBox'
Regards Robert

May 12 '06 #8
And youve solved it in Seconds. You right, I will go read some books.
Jumped in to far on this. Thanks for your reply and thanks to you all.
Regards Robert

May 12 '06 #9
You have to assign it to the .Text property, not to the TextBox itself:

textBox1.Text = bf.IsLoggedIn.ToString();

May 12 '06 #10

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

Similar topics

2
by: Rick Austin | last post by:
I recently had to perform a reinstalltion of Windows XP (my registry seems to have become corrupt). After this completed I had to reinstall all applications since most use the registry for settings,...
4
by: Lyn | last post by:
Hi, This question may seem a bit academic... To learn more about Access VBA, I have been enumerating the properties of various form controls. This was mostly successful and I have learned a lot...
10
by: Sunny | last post by:
Hi, I have an old problem which I couldn't solve so far. Now I have found a post in that group that gave me an idea, but I can not fully understand it. The problem is: I'm trying to use a...
6
by: JerryP | last post by:
Hello, is there a way to launch the property dialogue for a directory from my c# app ? I would also like to launch the User Account Properties from Active Directory Users and Computers, and the...
3
by: Martin Montgomery | last post by:
I have, for example, a property called myProperty. I would like, when using a property grid to display the property name as "My Property". Is this possible. Is there an attribute etc Thank ...
7
by: Donald Grove | last post by:
Is it possible to retrieve field properties from a table in access2000 using code? I have tried: " dim dbs as dao.database dim tbl as dao.tabledef dim fld as dao.field dim prop as...
1
by: Christophe Peillet | last post by:
I have a CompositeControl with two types of properties: 1.) Mapped Properties that map directly to a child control's properties (ex.: this.TextboxText = m_txt.Text). These properties are handled...
7
by: Anderskj | last post by:
Hi! I am developing a c# application. I have a interface (which can change therefore my problem) If i do like this: List<PropertyInfoproperties = new List<PropertyInfo>();...
0
by: =?Utf-8?B?UmljayBHbG9z?= | last post by:
For some unknown reason (user error?), I cannot get a NameValueCollection to persist in the app.config file. Unlike other settings, I cannot get the String Collection Editor GUI to allow my to...
4
by: FullBandwidth | last post by:
I have been perusing various blogs and MSDN pages discussing the use of event properties and the EventHandlerList class. I don't believe there's anything special about the EventHandlerList class in...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.