dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: Custom control that adds additional control

  1. #1
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263

    Question Custom control that adds additional control

    I am designing a custom control and I need to have the control add an additional control to the form when a specific property is set to True. The best way I can describe it is like in MS Access forms when you set the record selectors property to true is adds a long button to the left side of the form and if you change it back it removes the button. The control I am designing is going to be docked at the bottom of the form and when the specific property is set to true it needs to add a control docked to the left side of the form just like Access does with its record selector control. I would make it one control but I can't have one part docked at the bottom and another part of it docked on the left side so I figure it needs to be broken up into two controls. The other catch is that the Main control which is at the bottom of the form needs to respond to the events of the control which it adds to the left side of the form.
    Any Help would be greatly appriciated.

  2. #2
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    Try this;
    make a parent invisible control that cover the whole form and put in it both two other controls, then when control1 get changed its property to true , it will comunicate with the parent control which can make what u need with the control2 as a control in it ..
    I think u understand the rest .. try it .
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  3. #3
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263
    Ok so the parent control automatically resizes to the entire form, the background would be transparent, not invisable, becaues that would make all of the other contained controls invisable as well. Now I should not make it a container so that any controls added to the form don't get added to my control, only added to the form. This sounds promising I will give it a try, thank you!

  4. #4
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    Yea u r right about visibility, but if u r in the case of making it transparent, u may make one only control with some part transparent in it to show the bottom bar, and the left bar when needed .. but dealing with this I think will make u overload uneeded coding and time in your project, so why not try to solve this by for example making a property called background, bydefault equal the container form backcolor ... yes u may add additional controls over this control but this will not affect any thing and the control will look like invisible in case container form backcolor , the problem if u have a background picture u need to redraw it again .. but remember the parent control will cover the whole form so no panic with this again as drawing this picture in it will look like as if it was transparent .
    Hope this helps and gives u idea .
    Sincerely .
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  5. #5
    Join Date
    Aug 2004
    Location
    Orange, California
    Posts
    1,263
    None of my controls need to be transparent. So having the background transparent is fine. It does not need to be set by users. I just need a way to show the controls docked at the bottom and be able to add or remove the one docked on the left. I might even allow them to dock it on the right if they want. The main controls need to be docked at the bottom to get the effect I want. When you add my control to the form I want it to seem like it is an extension of the form. Like having an enhanced form with extra features that my control provides. I don't want it to get in the way of the forms normal use, like adding other controls which can set properties and respond to events, including those that are providrd by my control.

  6. #6
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    I meant some thing like this :

    Dim f As Form
    Set f = UserControl.ContainerHwnd
    UserControl.BackColor = f.BackColor
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

Similar Threads

  1. Updating Composite Custom Server Control
    By Magdalene in forum ASP.NET
    Replies: 0
    Last Post: 11-07-2006, 03:32 AM
  2. Custom Control Properties
    By Jugg in forum .NET
    Replies: 2
    Last Post: 03-07-2006, 07:40 AM
  3. Loading Custom Control onto the form
    By Sync in forum VB Classic
    Replies: 4
    Last Post: 12-07-2005, 02:21 AM
  4. Replies: 6
    Last Post: 02-22-2005, 03:12 AM
  5. ListView Control and Custom Sorting
    By Birhanu in forum VB Classic
    Replies: 0
    Last Post: 11-09-2001, 04:26 PM

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