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

    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.

    Explore Teams Create a free Team
  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, 3 months ago Modified 9 years, 3 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,0675 gold badges19 silver badges31 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.

  • Featured on Meta
  • We spent a sprint addressing your requests — here’s how it went
  • Upcoming initiatives on Stack Overflow and across the Stack Exchange network...
  • The [lib] tag is being burninated
  • What makes a homepage useful for logged-in users
13 Adding a user control using Windows Form designer 4 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 39 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

  • custom PCB design for UART-TTL to STM32
  • Transhumans, posthumans, and AI attacked by baseline humans
  • Can a country refuse to deliver a person accused of attempted murder?
  • Equivalence of inverse transformations under distributional equivalence
  • Why the number of bits or bytes is different for a folder that has been copied between two external drives?
  • Who is the woman who speaks when the Ravagers stop the Benatar?
  • Minimum number of select-all/copy/paste steps for a string containing n copies of the original
  • Plastic plugs used to fasten cover over radiator
  • How can I power both sides of breaker box with two 120 volt battery backups?
  • Job talk Q&A: handling the room vs. being respectful
  • Would it be moral for Danish resitance in WW2 to kill collaborators?
  • If I Trace "Pickup", will I pickup?
  • Can player build dungeons in D&D? I thought that was just a job for the DM
  • Why was this a draw? What move I supposed to play to win?
  • Question about NMAP HTTP Verb Tampering
  • Do you always experience the gravitational influence of other mass as you see them in your frame?
  • Can I convert 50 amp electric oven circuit to subpanel, and power oven plus water heater, plus maybe a car charger?
  • Simulate slow disks in KVM to see effect of LVM cache in test setup
  • Recommend an essay, article, entry, author, or branch of philosophy that addresses the futility of arguing for or against free will
  • When do people say "Toiletten" in the plural?
  • A manifold whose tangent space of a sum of line bundles and higher rank vector bundles
  • Different letters, different grids
  • How can one apply to graduate school if their undergraduate university is uncooperative in providing the required information?
  • Directions of puff pastry folds
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