New topic: No Class With This Name
<http://forums.realsoftware.com/viewtopic.php?t=30610> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message Wolfsnap Post subject: No Class With This NamePosted: Thu Oct 22, 2009 5:27 pm Joined: Thu May 10, 2007 10:25 pm Posts: 25 I'm working on a project where I need to clone instances of controls on the fly. Being that I didn't have much luck starting out, I went back to the user's guide for a basic re-learn and tried the simple "button clone" code within: Code:Dim pb as PushButton pb= New PushButton1 //clone of PushButton1 pb.Caption="Clone" //change caption just to be clear about this pb.Left=me.Left+me.Width+10 //move it to the right All I have is a window with a pushbutton PushButton1 with index 0. The above code is in it's action event It doesn't compile - I get "There is no class with this name" highlighting "pb= new PushButton1" What's going on? I've checked several times to make sure that it was a pushbutton I used, re-checked the name - no go...? Help!! Top sbeach Post subject: Re: No Class With This NamePosted: Thu Oct 22, 2009 5:55 pm Joined: Wed May 10, 2006 1:27 pm Posts: 7 Double check the name of your pushbutton in the window editor, make sure that it is actually PushButton1. Is this code within the action event of the push button? I don't see anything wrong with the code, I just tried it and it worked fine for me. The only thing I can think of aside from a naming type is that PushButton1 is out of scope wherever this code is being called from. _________________ -Sean Top JShaffer Post subject: Re: No Class With This NamePosted: Thu Oct 22, 2009 6:05 pm Joined: Fri Jan 23, 2009 9:18 am Posts: 8 Location: Summerfield, Florida Also, make sure you set the index value of the pushbutton to zero in the IDE. Jim Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
