Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / April 2005

Tip: Looking for answers? Try searching our database.

Problems with reading tag property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rod - 06 Apr 2005 16:28 GMT
At design time I have entered some text into the tag property of some of my
controls.
(text boxes, labels etc)

At run time I try and read the tag (MyCntrl.Tag.ToString), but it is always
empty.

Any help very much appreciated.

thanks

Rod
Tim Wilson - 06 Apr 2005 16:37 GMT
It seems to work ok for me. Are you sure that you have added text to the Tag
property? Is it being persisted in the InitializeComponent method?

Signature

Tim Wilson
.Net Compact Framework MVP

> At design time I have entered some text into the tag property of some of my
> controls.
[quoted text clipped - 8 lines]
>
> Rod
Rod - 06 Apr 2005 17:23 GMT
yes, here it is
Me.txtbxBillingPhone.Tag = "Organisation"

cheers

> It seems to work ok for me. Are you sure that you have added text to the Tag
> property? Is it being persisted in the InitializeComponent method?

> > At design time I have entered some text into the tag property of some of
> my
[quoted text clipped - 10 lines]
> >
> > Rod
Tim Wilson - 06 Apr 2005 17:41 GMT
And if you were to, let's say from a Button Click event handler, call the
following line of code it, it does not display the correct text?
MessageBox.Show(Me.txtbxBillingPhone.Tag.ToString())

Signature

Tim Wilson
.Net Compact Framework MVP

> yes, here it is
> Me.txtbxBillingPhone.Tag = "Organisation"
[quoted text clipped - 19 lines]
> > >
> > > Rod
Rod - 06 Apr 2005 17:59 GMT
You've led me to my mistake.
Thank you

> And if you were to, let's say from a Button Click event handler, call the
> following line of code it, it does not display the correct text?
[quoted text clipped - 24 lines]
> > > >
> > > > Rod
Herfried K. Wagner [MVP] - 06 Apr 2005 17:11 GMT
"Rod" <RodRodRodRod@Hotmail.com> schrieb:
> At design time I have entered some text into the tag property of some of
> my
[quoted text clipped - 4 lines]
> always
> empty.

Works fine for me too (.NET 1.1 SP1).

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.