473,320 Members | 2,035 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,320 software developers and data experts.

VisibleClipBounds

ata
Hi,
Consider a custom control, say, MyControl that's being derived from
Control.

1. How am I supposed to set the initial size of MyControl? Am I
supposed to override the DefaultSize property?

2. If so, the VisibleClipBounds of the control is not actually what
I've asked in the DefaultSize property, if the BorderStyle of
MyControl is set to FixedSingle or Fixed3D. i.e., if the DefaultSize
is set to "300, 100"; the actual size of the VisibleClipBounds in the
OnPaint method will be "296,96" which is obviously 4 pixels lower than
expected.

Any help would be highly appreciated,
Thanks.
Jun 27 '08 #1
1 3107
On Fri, 02 May 2008 08:22:39 -0700, <at*@mailinator.comwrote:
Hi,
Consider a custom control, say, MyControl that's being derived from
Control.

1. How am I supposed to set the initial size of MyControl? Am I
supposed to override the DefaultSize property?
Usually, the initial size of your control would be set in the Designer
when you drag it onto another form. But yes, if you want your control to
inherently have some specific default size, overriding DefaultSize is the
way to do that.
2. If so, the VisibleClipBounds of the control is not actually what
I've asked in the DefaultSize property, if the BorderStyle of
MyControl is set to FixedSingle or Fixed3D. i.e., if the DefaultSize
is set to "300, 100"; the actual size of the VisibleClipBounds in the
OnPaint method will be "296,96" which is obviously 4 pixels lower than
expected.
I haven't done much with custom bordered controls, but it seems pretty
clear to me that when the border is drawn within the boundary of the
control (as opposed to a window/form where the border is draw in the
"non-client" area), that the border will occupy part of the client area.
If you want your client area to be a full 300x100, you need to set the
size of the control a little larger to account for the border.

Pete
Jun 27 '08 #2

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

Similar topics

0
by: Brett | last post by:
I have a program that prints 2 different reports and I have 2 different printers (hp 9000, hp9050). The first report prints perfectly on both printers. The second only prints pefectly on the...
5
by: Devin Dow | last post by:
Print Preview looks perfect, but the Printout is cut off (extends off the page). Has anyone else experienced this? A3 paper size seems to exacerbate the problem. I can't believe it because...
1
by: Francesco | last post by:
I've got some problems printing to a dot matrix printer. After correctly setting all the charecteristics of my papersize in the BeginPrint()... private void pdLabelDoc_BeginPrint(object sender,...
2
by: Pkant | last post by:
I want to Print a txt file with this code : class Printing { PrintDocument prndoc = new PrintDocument(); PrintPreviewDialog ppd = new PrintPreviewDialog();
11
by: Andrew | last post by:
Hello, I understand that this is a good place to post suggestions about future changes to the language, and that the Microsoft developers who develop C# read this newsgroup. If there is a more...
8
by: Tinus | last post by:
Hello all, Because you have been so helpfull the last couple of times, I thought after testing and wasting more than 20 pages (and google-ling for 3 days :-( ). I would ask you again for your...
1
by: Joshua Anderson | last post by:
Hi, Ok I am doing a print app, what I am trying to do is get the EXACT boundaries of the page, I want to print to the top left, 0,0, which is fine, but bottom right is a problem. When I use...
0
by: Gerald Roston | last post by:
I have an application that is supposed to print a badge using a Dymo LabelWriter 330. The problem I am having is this - when I 'Print Preview' the badge, it is displayed properly, but when I...
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.