I am not sure about putting Form in Panel, sounds wired.
Try this
- Use MDI Form or (Can't be put in Panel)
- UserControl to put in the Panel.

>From what I understood what is you trying to do, User Control is the
best. Otherwise, you can make popup Form by just show it "Form2.Show
(this);" or "Form2.ShowDialog(this);".

I am not sure the shortcuts can be functioning by this way or not.
However you can use custom code to listen to windows message that can
handle hotkey message, but it is difficult.

Hm...
Maybe you said floating because of you use Form2.Show() and the Form2
is not in Form1. It shoulb be like that. There is no way to put in
Panel, because it is Form. Instead, use User Control I mention above.
It is just like a Form but with no title bar. To do that:

1. Create User Control named UserControl1.
2. Place a control into it. E.g: drag Button, TextBox into the
UserControl1.
3. Rebuild the project. (Compulsory, otherwise UserControl1 is not in
your Toolbox)
4. The UserControl is placed in Toolbox, drag it into your main Form
or Panel in main Form. OR
5. Creat instance in code and add into Panel control. E.g:
Panel1.Control.Add(UserControl1)

 Updating controls in User Control will also update where you place
it.


On Feb 23, 1:57 pm, Savani Mahesh <[email protected]> wrote:
> Hi,
>
> Visual Studio 2005, C# .Net 2.0. Window Forms Application.
>
> I created a form with 2 panels. One panel containing 3 links to other 3
> forms, second panel to hold the form. When user clicks on a link, I create
> instance of form, set its TopLevel property to false and add the form to
> second panel.
>
> Problems I am facing are,
> 1) Form residing into the panel never get focus. So all shortcuts which
> works fine, when form is opened normally as a TopLevel control, do not work.
> The reason I guess is that "Form Into Panel" never gets windows messages,
> generated by OS central message loop, instead its parent form gets messages.
>
> 2) The form added to panel is floating. How to stop floating?
>
> Please any one can help.
>
> Regards,
> Mahesh

Reply via email to