Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / General 2 / January 2007



Tip: Looking for answers? Try searching our database.

Method or data member not found

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chuck - 26 Jan 2007 15:27 GMT
Form has Label named lblOne with Caption blank
Code:  lblOne.Caption = "One"
Error message:  Method or data member not found.
Caption is highlighted
If .Caption is deleted then "." typed, drop down box list only shows: Count,
Item,  LBound, UBound

If label is deleted and replaced with a text box and code is changed to:
txtOne.   the drop down list includes "Text" and Text is selected. then =
*calculated numerical data value* follows Text.  Program runs.

Then second text box added to form named txtTwo and code is added simular to
that for text box one, above error message comes up.

Again drop down box now only shows the Count etc list.

Delete second text box and now first text box that ran OK is now showing the
error message.

A different project is using a single label to show calculated numerical data
OK.

Is the problem that only one label or text box can be used to show data on a
form?  Each label or text box has a unique name.

I am a member of a local computer club with more than 350 members.  I am the
only one who writes code.

Chuck
--
Jan Hyde - 26 Jan 2007 15:44 GMT
Chuck <libbeyc@schoollink.net>'s wild thoughts were released
on Fri, 26 Jan 2007 10:27:48 -0500 bearing the following
fruit:

>Form has Label named lblOne with Caption blank
>Code:  lblOne.Caption = "One"
>Error message:  Method or data member not found.
>Caption is highlighted
>If .Caption is deleted then "." typed, drop down box list only shows: Count,
>Item,  LBound, UBound

You have used a control array

lblOne(0).caption

would set the caption for item 0 in the array.

J

>If label is deleted and replaced with a text box and code is changed to:
>txtOne.   the drop down list includes "Text" and Text is selected. then =
[quoted text clipped - 18 lines]
>
>Chuck

Jan Hyde (VB MVP)

Signature

Did you ever date a witch? Yes, but just for a spell. (Bob Thaves)

Chuck - 26 Jan 2007 23:08 GMT
>Chuck <libbeyc@schoollink.net>'s wild thoughts were released
>on Fri, 26 Jan 2007 10:27:48 -0500 bearing the following
[quoted text clipped - 39 lines]
>
>Jan Hyde (VB MVP)

Yes I did - sort of.  I made one label postioned and sized it the way I wanted,
Then did several copy and pasts, repositioned and re-named.

I deleted all the labels and individually re-installed.
All is fine now.

Thank you very much Jan.

Chuck
Steve Gerrard - 27 Jan 2007 01:58 GMT
> Yes I did - sort of.  I made one label postioned and sized it the way I
> wanted,
> Then did several copy and pasts, repositioned and re-named.

You probably should have answered No to the pop up question "Wanna make a
control array?"

> I deleted all the labels and individually re-installed.
> All is fine now.

FYI, you can also un-array-ify the labels by
   1. changing the name of each label, so they all have different names, and
   2. setting the Index property of each label to blank
Chuck - 27 Jan 2007 13:11 GMT
>> Yes I did - sort of.  I made one label postioned and sized it the way I
>> wanted,
[quoted text clipped - 9 lines]
>    1. changing the name of each label, so they all have different names, and
>    2. setting the Index property of each label to blank

I did change the name of each label.  The values in the index property were not
blank, but they were all different.  You did say 1 *and* 2, not 1 *or* 2.

Chuck
Steve Gerrard - 27 Jan 2007 17:36 GMT
>>FYI, you can also un-array-ify the labels by
>>    1. changing the name of each label, so they all have different names, and
[quoted text clipped - 3 lines]
> not
> blank, but they were all different.  You did say 1 *and* 2, not 1 *or* 2.

Yes, that's right. If you had, for instance, LabelA(0), LabelB(1), and
LabelC(2), you would have three separate control arrays, each with one element
in them. To set their captions, you would have to type LabelB(1).Caption =
"boo", etc.

The control array is not a true array, it is more of a collection with integer
keys. Thus you could have LabelD(1) and LabelD(3), a control array with two
elements, whose indexes were not sequential. However, for reasons of sanity,
most VB programmers use control arrays with sequentially numbered elements,
starting at 0.
 
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



©2009 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.