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

Restricting the 'paintable' areas of a control

Is there any way to restrict the area in a control that can be painted? For
example, if I wanted to enforce a three-pixel wide border around my control,
how would I go about it?

Thanks
Nov 17 '05 #1
1 1355
For borders you should consider responding to the non-client messages such
as WM_NCCREATE and WM_NCPAINT. These allow you to set a client size that is
different from the overall control size.

For other painting issues you can use clipping regions to limit the output
of graphics to certain areas.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Barguast" <It*****************@Email.com> wrote in message
news:49**********************************@microsof t.com...
Is there any way to restrict the area in a control that can be painted?
For
example, if I wanted to enforce a three-pixel wide border around my
control,
how would I go about it?

Thanks

Nov 17 '05 #2

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

Similar topics

2
by: Xenophobe | last post by:
I have a popup window (required by the client) containing a form and would like to prevent users from accessing it directly. They are instead required to access the page via a hyperlink on another...
13
by: Dave Holmes | last post by:
Is there a way to keep an other application from opening a link in a browser where I am running an ASP application? For example, I have an ASP application open in a browser. If I click on a link...
3
by: MoCha | last post by:
hello everyone, i want to know of any trick used to restrict the access scope of a friend class (or function). ie instead of the friend class having access to the entire internals of the class in...
4
by: Dennis C. Drumm | last post by:
Is there a way with C# to allow one class access to a method or field of another class, without making that method or field visible to all other classes, as would be the case when making the method...
1
by: John Mason | last post by:
I'm trying to restrict the selection of files to jpg; gif etc. in an HtmlInputFile control. All the documentation says use the Access property but this doesn't work. It doesn't show up in...
3
by: T Cordon | last post by:
I have seen some controls that disable the height option at design time, you cannot drag and change it's height how can this be done? Thanks
0
by: FredC | last post by:
I'm using VS C#.Net 2003. I built a simple windows form app. with the following attributes: - has a BackgroundImage set to a jpeg I built a very simple user control that contains a picture box set...
6
by: Jason Wilson | last post by:
I need to restrict printing to certain users and log printing within an ASP.NET 2.0 application. Any suggestions on how to do this? The only idea I could come up with is launch the application...
8
by: sneddo | last post by:
Ok I am trying to do the above, I have got a script that will restrict the length but it requires the user to enter the field and hit a key, before it will work. This would normaly be find, but...
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
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.