getting the name of the application that contains my control


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: getting the name of the application that contains my control

Hybrid View

  1. #1
    Floyd McDonald Guest

    getting the name of the application that contains my control


    I created a control for saving the size and position of a form in the registry.
    You drop the control on the form and it does the rest - when the user resizes
    the form the control makes a new entry in the registry so and when the application
    starts again the control gets that info from the registry and resizes the
    form to the size it had when the appliction was last running. There is just
    one problem with it. I used the form name for the name of the registery key
    to store this information. This works great in most situations but if I use
    the control in two different applications which have forms that have the
    same name then I run into a problem. For example if project1 has a form called
    form1 and project2 has a form called form1
    my control saves the form height in HKEY_CURRENT_USER\software\VB and VBA
    program settings\formsaver\formsaver\form1\form1.height for both projects.
    What I need is a way for the control to get the name of the application that
    contains the form in which it is contained. If I use app.exename I get the
    name of my control - not the name of the application which is using my control.
    I can get the name of the form that contains my form with usercontrol.parent.name
    but my question is how can my user control get the name of the application
    which is using it. Thanks for your patientence reading this and thanks to
    Steve (kinell_98@yahoo.com) who did a great job of explaining how to make
    my control aware of the container form's events.



  2. #2
    hquijano Guest

    Re: getting the name of the application that contains my control


    "Floyd McDonald" <floydmcdonald@hotmail.com> wrote:
    >
    >I created a control for saving the size and position of a form in the registry.
    >You drop the control on the form and it does the rest - when the user resizes
    >the form the control makes a new entry in the registry so and when the application
    >starts again the control gets that info from the registry and resizes the
    >form to the size it had when the appliction was last running. There is just
    >one problem with it. I used the form name for the name of the registery

    key
    >to store this information. This works great in most situations but if I

    use
    >the control in two different applications which have forms that have the
    >same name then I run into a problem. For example if project1 has a form

    called
    >form1 and project2 has a form called form1
    >my control saves the form height in HKEY_CURRENT_USER\software\VB and VBA
    >program settings\formsaver\formsaver\form1\form1.height for both projects.
    >What I need is a way for the control to get the name of the application

    that
    >contains the form in which it is contained. If I use app.exename I get the
    >name of my control - not the name of the application which is using my control.
    >I can get the name of the form that contains my form with usercontrol.parent.name
    >but my question is how can my user control get the name of the application
    >which is using it. Thanks for your patientence reading this and thanks to
    >Steve (kinell_98@yahoo.com) who did a great job of explaining how to make
    >my control aware of the container form's events.
    >
    >


    i got a little ocx that implements what you needs, i will send it to your
    mail because is long to explain here, good luck. :-)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center