473,396 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Can't access panel.ClientRectangle

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 2040
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(panel1, Control).ClientRectangle

That sounds awfully strange.

Chris

Jul 26 '07 #2
DM
"Chris Dunaway" <du******@gmail.comwrote in message
news:11**********************@o61g2000hsh.googlegr oups.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(panel1, Control).ClientRectangle

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.ClientRectangle )

....and I get a 'ClientRectangle' 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
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; ...
5
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...
4
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...
4
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...
7
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...
2
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),...
1
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...
5
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': ...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.