473,382 Members | 1,377 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,382 software developers and data experts.

How can change the bounds of the client area of a control ?

How can change the bounds of the client area of a control ?



In fact I would like to have a Panel with Raised borders. I can draw the raised borders but they disappears as soon as I put control inside with it's Dock property set to DockStyle.Fill.



I tried using the "SetClientSizeCore" of my derived Panel..but it doesn't work...

Any help is greatly appreciated !!



Thanks,



Steph.
Nov 17 '05 #1
2 2591
You'd be best to have the border be treated as non-client area. Try
adjusting the border style using the "GetWindowLong" and "SetWindowLong"
Win32 APIs. You should be able to get what you need at
http://www.pinvoke.net/

--
Tim Wilson
..NET Compact Framework MVP

"Steph." <st***@nomail.com> wrote in message
news:eb**************@TK2MSFTNGP15.phx.gbl...
How can change the bounds of the client area of a control ?

In fact I would like to have a Panel with Raised borders. I can draw the
raised borders but they disappears as soon as I put control inside with it's
Dock property set to DockStyle.Fill.

I tried using the "SetClientSizeCore" of my derived Panel..but it doesn't
work...

Any help is greatly appreciated !!

Thanks,

Steph.
Nov 17 '05 #2
You need to handle the WM_NCPAINT and WM_NCCALCSIZE messages directly. You can change the size and position of the client area within the control and paint your own custom borders.

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

Ramuseco Limited .NET consulting
http://www.ramuseco.com

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.

"Steph." <st***@nomail.com> wrote in message news:eb**************@TK2MSFTNGP15.phx.gbl...
How can change the bounds of the client area of a control ?



In fact I would like to have a Panel with Raised borders. I can draw the raised borders but they disappears as soon as I put control inside with it's Dock property set to DockStyle.Fill.

I tried using the "SetClientSizeCore" of my derived Panel..but it doesn't work...

Any help is greatly appreciated !!



Thanks,



Steph.
Nov 17 '05 #3

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

Similar topics

0
by: Ken Seier | last post by:
Hello, I'm trying to create a fairly standard custom container control by using the ScrollableControlDesigner attribute. My control has a title bar at the top, and I would like to exclude the...
0
by: Eugene | last post by:
Hello all, I've been trying to figure this out for a few days now, and still have no clue what's going on... I have a few related tables in MS Access (Clients, Cars, Sales), and a datagrid,...
50
by: jacob navia | last post by:
As everybody knows, the C language lacks a way of specifying bounds checked arrays. This situation is intolerable for people that know that errors are easy to do, and putting today's powerful...
2
by: Sean | last post by:
Hi all, I have a treeview and because I subclass the treeview and allow multiple selection to be done on the treeview, I have a problem changing the background color of the treeview. The...
3
by: TheSteph | last post by:
Hi, I've made a CustomPanel derived from the Panel class. How can I set my own size of the "client area" of that CustomPanel ? ("client area" = Size of the rectangle in which one can drop...
6
by: Jan Heppen | last post by:
Is it posible to set something so that when my vb.net (visual studio 2005, framework 2.0) application is busy that the mouse pointer change into a hourglass ? Or do i have to set everywhere...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
9
by: Tom P. | last post by:
I am creating a custom control and I'm trying to get the painting of it correct. I'd like to simply use: e.Graphics.FillRectangle(Brushes.White, DisplayRectangle); .... or ......
3
by: CSharper | last post by:
Is it possible to selectivly change the color of an item in text. I saw ForeColor option, but it changes the color of all the items. If it is not possible, is there any other control list listbox...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.