HighTechTalks DotNet Forums  

RE: Drawing panel outside window bounds

Dotnet VJSharp microsoft.public.dotnet.vjsharp


Discuss RE: Drawing panel outside window bounds in the Dotnet VJSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default RE: Drawing panel outside window bounds - 10-24-2003 , 07:08 PM






| I am trying to update/Refresh a moving panel that is
Quote:
within a windows form that exceeds the forms bounds. I
would like to know how to reset the bounds...or have the
panel drawn. Its not visible at the moment. Thank you.
What type of panel are you working with? There is a .Net Panel in
System.Windows.Forms.Panel and there is also the Java panel in
java.awt.Panel.

System.Windows.Forms.Panel has a Size property that you can use to set the
size of the panel
java.awt.Panel has a setBounds() method that allows you to set the bounds
for the panel.

I hope this is helpful,

Thanks,

Michael Green
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only.



Reply With Quote
  #2  
Old   
 
Posts: n/a

Default RE: Drawing panel outside window bounds - 10-25-2003 , 03:27 PM






Hi...Thanks Michael Green for replying so soon. Um this
kind of panel that im using is a Windows.Forms.Panel
panel, and to elucidate my issue, here is some pseudo
code:

Ive defined my panel to be the exact dimiensions of my
window which is also underneath stuff on the window and
is not currently visible, and i would like for the panel,
after button gets pressed, to slide to the right
exceeding the window bounds, now becming visible to the
user, and slide back in given the same button press. I
haver the code correct for this. The problem is that, I
would not like to expand the size of the window to
accomodate this sliding panel, but would like for the
panel to be drawn outside the window bounds as it should,
if it were not for the restriction on painting things
outside a window dimension. I do not know how to reset
these bounds that would allow the panel, without
expanding the window size, to be drawn.

Here is my current clips of actual code:

Windows Generated:

//
// panel1
//
this.panel1.set_BorderStyle
(System.Windows.Forms.BorderStyle.Fixed3D);
this.panel1.get_Controls().Add
(this.button1);
this.panel1.get_Controls().Add
(this.groupBox2);
this.panel1.get_Controls().Add
(this.lstGames);
this.panel1.set_Location(new
System.Drawing.Point(-4, -4));
this.panel1.set_Name("panel1");
this.panel1.set_Size(new
System.Drawing.Size(298, 472));
this.panel1.set_TabIndex(8);
this.panel1.add_Paint( new
System.Windows.Forms.PaintEventHandler
(this.panel1_Paint) );


My code:

if (this.pressed == false)
{
for (int i = 0; i <=
this.panel1.get_Width(); i+=15)
{
//this.set_Width
(this.get_Width() + 15);
if ( i > 0 )

this.panel1.set_Location(
new System.Drawing.Point( i , 0 ));

this.Refresh();

}
this.pressed=true;
return;
}
..

The //this.set_Width(this.get_Width() + 15); clipit was
purposefully commented out to show that I do not want to
have to do this. I would like fo rthe panel to be drawn
exceeding the bounds without having to redraw the window
container that it is in. I stheire a way of resetting
the region for paint or something...I only know J# by the
way. Thanks a billion!



Reply With Quote
  #3  
Old   
AT
 
Posts: n/a

Default RE: Drawing panel outside window bounds - 10-27-2003 , 08:03 PM



I just want to make sure I understand what you are looking for. Do you want
the portion of the panel that exceeds the form's bounds to be painted or
clipped? If you want it to be painted you will need to create a new form
for that since the panel is a child of the form and will therefore be
clipped by the form. Otherwise we will have to manually resize the form.
Let me know which you are looking for and we can take it from there and see
what we can come up with.
-
Thanks,

Michael Green
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only.


Reply With Quote
  #4  
Old   
 
Posts: n/a

Default RE: Drawing panel outside window bounds - 10-30-2003 , 04:45 AM



I had wished for the panel to be painted outside the
form. Was wondering if could be done without creating
another window.
Thanks again.

Reply With Quote
  #5  
Old   
AT
 
Posts: n/a

Default RE: Drawing panel outside window bounds - 10-31-2003 , 03:42 PM



Because the panel is a child of the form, it will be clipped. If you need
the panel to extend beyond the boundary of the form you will need to use a
different form.

Thanks,

Michael Green
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.