creating a control without a form

  • Thread starter Thread starter guy
  • Start date Start date
G

guy

i am trying to create a custom Combobox from scratch.
this requires that i create the list that the combobox
opens. i've used the ListBox control to do this.

my problem is that i don't know how to "Pop" the list
without it being on a form, but a form can be accessed
through ALT-TAB and Task Manager. and it creates problems.

so can anybody tell me how i can create the list without
a form or maybe make the form act correctly (not showing
on ALT-TAB and not being a seperate proccess)

please help!
 
i am trying to create a custom Combobox from scratch.
this requires that i create the list that the combobox
opens. i've used the ListBox control to do this.

Why didn't you inherit a ComboBox? Anyway...
my problem is that i don't know how to "Pop" the list
without it being on a form, but a form can be accessed
through ALT-TAB and Task Manager. and it creates problems.

Controls need a parent (a Form in this case). How are you currently
showing it? Using a Form the same size as the control, or something?
so can anybody tell me how i can create the list without
a form or maybe make the form act correctly (not showing
on ALT-TAB and not being a seperate proccess)

Make sure the Form has ShownInTaskbar=False.

Rgds,
 
1. I am applying a new style and am adding another button (exept the
drop-down button) so i can't inherit the combobox class

2.yes, currently the list is on a form of the size

3.setting the ShowInTaskbar property to false doesn't prevent the form
from being a seperate process thus accesible from ALT-TAB and Task
Manager (This is what i am trying to prevent)
 
Hi Guy,

seperate process? what the hell are you talking about?
Do you mean you have two forms in your application? Two forms are not two
processes! Anyway...

You created a control... ok, your control inherits what?
Always must inherit something (at least Object)... Inherits UserControl?
Most custom controls inherit UserControl.

You can drag-and-drop built UserControls from the ToolBox into your form.

Yes, I antecipate your rumble about transparent controls. That is tabu.
Sometimes regions may do the trick, other times it's realy hardcore,
subclassing, etc...
http://www.c-sharpcorner.com/Code/2003/May/TransparentControls.asp
http://www.elitevb.com/content/01,0071,01/

Regards,
Mario
 
I seem to have not explained myself properly:

I am trying to build a custom ComboBox:
I need to do so without inheriting the ComboBox class
for the combobox object itself, i am using a UserControl with a text box
on it( the border and drop down button are painted via GDI+)
my problem is what to do when the user clicks the drop down button. i
need a list to open. so far i am using a form Containing a ListBox
Control.
My problem is that using the form causes some problems: the form can be
accessed through ALT-TAB and Windows Task Manager. this is something i
don't want happening.
 
Back
Top