473,806 Members | 2,319 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't access panel.ClientRec tangle

DM
Hi All,

I'm having trouble accessing the ClientRectangle property on a panel
control.

At design-time it says that ClientRectangle is not a member of the Panel
class, but when I look at the QuickWatch at run-time I can clearly see it is
part of the control parameters.

Am I missing something obvious? I'm running Visual Basic .NET v1.1.

-Duncan
Jul 26 '07 #1
2 2065
On Jul 25, 9:50 pm, "DM" <nos...@nospam. orgwrote:
Hi All,

I'm having trouble accessing the ClientRectangle property on a panel
control.

At design-time it says that ClientRectangle is not a member of the Panel
class, but when I look at the QuickWatch at run-time I can clearly see it is
part of the control parameters.

Am I missing something obvious? I'm running Visual Basic .NET v1.1.

-Duncan
I have no trouble accessing the ClientRectangle property. Can you
show some segment of code that shows the problem? Have you tried
casting to Control to get it:

Dim r As Rectangle = DirectCast(pane l1, Control).Client Rectangle

That sounds awfully strange.

Chris

Jul 26 '07 #2
DM
"Chris Dunaway" <du******@gmail .comwrote in message
news:11******** **************@ o61g2000hsh.goo glegroups.com.. .
On Jul 25, 9:50 pm, "DM" <nos...@nospam. orgwrote:
>Hi All,

I'm having trouble accessing the ClientRectangle property on a panel
control.

At design-time it says that ClientRectangle is not a member of the Panel
class, but when I look at the QuickWatch at run-time I can clearly see it
is
part of the control parameters.

Am I missing something obvious? I'm running Visual Basic .NET v1.1.

-Duncan

I have no trouble accessing the ClientRectangle property. Can you
show some segment of code that shows the problem? Have you tried
casting to Control to get it:

Dim r As Rectangle = DirectCast(pane l1, Control).Client Rectangle

That sounds awfully strange.

Chris
Thanks, that seems to work fine.

As for a code snippet, all I do is add the panel to a form at design-time
then try to access that parameter from within the form code. ie.

MyFunction( Me.pnlMyPanel.C lientRectangle )

....and I get a 'ClientRectangl e' is not a member of class Panel... Very odd
because it is listed as a member in the MSDN library and when observed via
QuickWatch.

In any case it is working now and I really appreciate your suggestion.

-Duncan
Jul 27 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9490
by: Alexander | last post by:
Hi, I have a simple Problem. I want to center a dialog on a panel of an application. I do the following: public class MyDialog : System.Windows.Forms.Form { private Panel m_ParentPanel; public MyDialog(Panel panel)
5
15632
by: Wilfried Mestdagh | last post by:
Hi, I seems not to find how to change borderstyle of a panel so that it is not sunken, but raised. I only find a 3d setting in obejct inspector... Someone knows this ? -- rgds, Wilfried http://www.mestdagh.biz
4
11702
by: Aaron Smith | last post by:
I have a panel that I have in the paint event to draw a Raised 3d border around it.. The problem is, if a msgbox is popped up or a tooltip is displayed, it leaves lines on the panel. I've tried invalidate after the msgbox to no avail... Here is the event: Private Sub Panel2_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Panel2.Paint ControlPaint.DrawBorder3D(e.Graphics, e.ClipRectangle,...
4
6796
by: Sarika | last post by:
I migrated a VB6.0 application to VB.NET. This app has a drawing area, which is a panel. The user can drag and drop several objects on this drawing area and can also draw lines, boxes etc. The app is sufferring from the problem of flicker. On reading several posts on this forum and others I decided to enable double buffering for my panel. However the drawing area appears blank. I can briefly see the objects when adding new objects on the...
7
18218
by: Sharon | last post by:
I’m using the Panel control that contains a PictureBox control (for implementing the http://www.codeproject.com/cs/miscctrl/PictureBox.asp). The Panel is set to AutoScroll = true. I wish to scroll the appearing vertical and horizontal scrolls bars of the Panel to the middle of their scrolling range so the contained PictureBox will be centered inside the Panel. But I could not find a way to get the scrolls bars for doing that.
2
12958
by: Chris S. | last post by:
Here's a starter for 10 - I have the following simple code: private void panel1_Paint(object sender, PaintEventArgs e) { e.Graphics.DrawRectangle(new Pen(Color.Blue), this.panel1.ClientRectangle); } Where a panel is on a form. I've always had to alter the 'rect' variable as it doesn't draw the border correctly, the right and bottom
1
6300
by: Robert W. | last post by:
In my WinForms app I've long been able to create a linear gradient effect by just intercepting the PaintEventHandler event. But I'd now like to create an inherited user control, specifically of a panel. I thought I was on the right track and did achieve the effect ... until I started putting some controls on the panel. Then I got an "Invalid parameter" error but don't understand what it's referring to. Based on examples I've found,...
5
5866
by: Adam Sandler | last post by:
Hello, I took a look at http://msdn.microsoft.com/en-us/library/aa287531(VS.71).aspx which gives a code sample on how to print a form. To print a panel, I just substituted 'p' for 'this': private void CaptureScreen(Panel p) { Graphics myGraphics = p.CreateGraphics(); Size s = p.Size;
1
6485
by: Cdude | last post by:
Hello. I need to make a 3D panel. At the moment i am using private void panel1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; Rectangle r = ClientRectangle; Border3DStyle style = Border3DStyle.RaisedInner; ControlPaint.DrawBorder3D(g, r, style, Border3DSide.All);
0
9597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10371
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3850
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.