How To Add A User Defined Control To A Form In VFP - Stack Overflow

Just browsing Stack Overflow? Help us improve your experience. Sign up for research
    1. Home
    2. Questions
    3. Tags
    4. Users
    5. Companies
    6. Labs
    7. Jobs
    8. Discussions
    9. Collectives
    10. Communities for your favorite technologies. Explore all Collectives

  1. Teams

    Ask questions, find answers and collaborate at work with Stack Overflow for Teams.

    Try Teams for free Explore Teams
  2. Teams
  3. Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

Get early access and see previews of new features.

Learn more about Labs How to add a user defined control to a form in VFP Ask Question Asked 9 years, 8 months ago Modified 9 years, 8 months ago Viewed 3k times 0

Hi: I have created a very simple user defined control (a container) with the visual IDE of Visual Foxpro 9 and stored it into a VCX file (sisweb.vcx)

After that I've created (visually) a form and in the INIT event I've tried to instantiate the previous container control and add to the form:

oContainer=newobject("xContainer","sisweb.vcx") ThisForm.AddObject("Contx","oContainer") ThisForm.Contx.Width=230

Unfortunatelly, when trying to ADD the container object, it rises an error saying that oContainer doesn't exists.

Can you help me please?

Share Improve this question Follow asked Mar 13, 2015 at 21:23 Alberto Garcia Cano's user avatar Alberto Garcia CanoAlberto Garcia Cano 31 silver badge2 bronze badges Add a comment |

1 Answer 1

Sorted by: Reset to default Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) 2

When you want to add an object dynamically at run-time, you could do something like

Thisform.NewObject("Contx", "xContainer", "sisweb.vcx") Thisform.Contx.Width = 230 Thisform.Contx.Visible = .T.

Where assigning the Visible property explicitly is important.

On the other hand, you could also add it "visually" in the Designer by dragging it from the Project Manager's "Classes" tab, or by using the bookshelf icon of the Form / Class Designer's "Controls" toolbar, or the "Toolbox" in the "Tools" menu

Share Improve this answer Follow answered Mar 14, 2015 at 6:26 Stefan Wuebbe's user avatar Stefan WuebbeStefan Wuebbe 2,1395 gold badges19 silver badges33 bronze badges 1
  • 1 It may be worth stating what Alberto did wrong -- specifically, that VFP does not allow an existing instance to be added to a container. (In fact, I'm not sure very many UI designers allow that, due to the potential headaches.) – DougM Commented Mar 16, 2015 at 16:14
Add a comment |

Your Answer

Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid …

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

Draft saved Draft discarded

Sign up or log in

Sign up using Google Sign up using Email and Password Submit

Post as a guest

Name Email

Required, but never shown

Post Your Answer Discard

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.

  • The Overflow Blog
  • The app that fights for your data privacy rights
  • Your docs are your infrastructure
  • Featured on Meta
  • More network sites to see advertising test
  • We’re (finally!) going to the cloud!
  • Call for testers for an early access release of a Stack Overflow extension...
13 Adding a user control using Windows Form designer 5 How to add a control to a Form programmatically? 0 Visual C#: How to add controls to a form created with code? 0 add a user control to a form 41 add user control to a form 0 Create class from form object 1 Foxpro, how to get access to form from menu buttons? 0 Load another form in Visual foxpro 1 Convert FoxPro form to a program file 1 How to add Custom Control in a form dynamically

Hot Network Questions

  • 6/3 nm-b short run outside to spa box in conduit
  • A dark animated movie about an orphaned girl working in an oppressive factory
  • What's the deal with Tex Live and cmunrm.otf?
  • Who can be proud of whom? Is there any limit?
  • Plotting wavy curve in Mathematica
  • Phrase out of figures
  • Uk exhibition pass query impact
  • Path from plane
  • Discrimination on the grounds of unsavoury religious beliefs?
  • Did renaissance actors learn their parts by heart?
  • Bank statement query for visa applications
  • Can you make 5 x 3 “magic” rectangles?
  • She locked the door securely behind her
  • Why don't routers answer ARP requests for IP addresses they can handle even if they aren't assigned that IP address themselves?
  • Origin of the character "力"
  • In a Frequentist setting, how are we able to condition on the null hypothesis being True/False?
  • Is this tv show example of hearsay actually hearsay?
  • Movie about a post apocalyptic world with a scorching hot sun
  • Frogs on lily pads want to make a party
  • Brushing pastries with jam
  • Advantages of information criteria over cross-validation
  • How can I solve my equation with the best numerical precision?
  • How can I protect ungrouted tile over the winter?
  • Do longer papers have lower chances of being accepted because they take up more "space" in a journal issue (STEM)
more hot questions Question feed Subscribe to RSS Question feed

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Từ khóa » Ctrl V C X