473,769 Members | 6,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VisibleClipBoun ds

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 VisibleClipBoun ds 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 VisibleClipBoun ds 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 3136
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 VisibleClipBoun ds 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 VisibleClipBoun ds 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
396
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 9000. On the 9050, I only get a small square's worth in the upper left corner. I've narrowed the problem down to the VisibleClipBounds(VCB) property of the Graphic object I'm using to do the drawing. For some reason, on the second report the VCB...
5
2242
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 the same code is executed with the same exact values when Printing and doing Print Preview. I've seen something like this in old Win32 programming caused by bad
1
3564
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, System.Drawing.Printing.PrintEventArgs e) { pdLabelDoc.PrinterSettings.PrinterName = "Epson LX-300"; printFont = new Font("Arial", 10);
2
2770
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
1994
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 appropriate place to post this, please let me know. So, here are a few things I'd like to see. 1. A way to declare a local variable as being readonly.
8
9630
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 help. The problem is this: If I print a rectangle which begins at (0,0) and the margins are also set to 0 (l:0, t:0, r:0, b:0) then it prints fine (ok, not quite because 0,0 is inside the none printable area but I corrected for that by checking...
1
1944
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 ".VisibleClipBounds.Width" I get the correct with the first time, for the default printer, that is set to A4. If I select another printer from the list, it gets a bit hairy.
0
1145
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 'Print' the badge, it is cropped. Let me show a code snippet and some debugging data: Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click printerSetup()
1
5720
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 of a Microsoft book, "Visual Basic,Net Step by Step" in Chapter 18. All but the bottom two subroutines will open a text file, and then allow me to use the above controls, example 1. The bottom two subroutines will print a graphic file, example...
0
9590
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10223
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10051
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
10000
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,...
0
9866
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
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
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
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

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.