473,399 Members | 3,603 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,399 software developers and data experts.

problem with creating new control

Hello,

I have to create my own control which might be an extension for a standard
'panel' control. I called it 'SmartPanel'. This is specialized panel. It
consists of a title bar and a client area on which other controls can be
placed. Depends on its state, it can shrink into one of its borders so only
title bar is visible in shrinked state. Problem is as follows: I want to be a
title bar with name of panel (e.g "Tools") and I paint it in a OnPaint event.
It is all ok, but when I put on my panel some other control (e.g other Panel
or Button) and when I set its Docking style (e.g to DockStyle.Right) its
covering title bar of my SmartPanel! I tried to figure out what's going on. I
found ClientSize property. Fine, but I can't use in when my SmartPanel is in
state 'dock to left' or 'dock to bottom' because of title bar is at beginning
of client area. ClientRectangle property is read only and in MSDN is written
that "the coordinates of the upper-left corner of the rectangle returned by
this property are (0,0)", but I want to upper-left corner starts at (0, 20)
for example. Please help me to solve this setting me mad problem...

thanks for advance.
Nov 16 '05 #1
3 1329
Hi Dariusz,

There is a "DockPadding" property of "ScrollableControl".
You can define it for dock offset.

Cheers!

Marcin
Hello,

I have to create my own control which might be an extension for a standard
'panel' control. I called it 'SmartPanel'. This is specialized panel. It
consists of a title bar and a client area on which other controls can be
placed. Depends on its state, it can shrink into one of its borders so only
title bar is visible in shrinked state. Problem is as follows: I want to be a
title bar with name of panel (e.g "Tools") and I paint it in a OnPaint event.
It is all ok, but when I put on my panel some other control (e.g other Panel
or Button) and when I set its Docking style (e.g to DockStyle.Right) its
covering title bar of my SmartPanel! I tried to figure out what's going on. I
found ClientSize property. Fine, but I can't use in when my SmartPanel is in
state 'dock to left' or 'dock to bottom' because of title bar is at beginning
of client area. ClientRectangle property is read only and in MSDN is written
that "the coordinates of the upper-left corner of the rectangle returned by
this property are (0,0)", but I want to upper-left corner starts at (0, 20)
for example. Please help me to solve this setting me mad problem...

thanks for advance.

Nov 16 '05 #2

Thanks for Your answer, it realy workarounds my problem. Code is nice and
works but I still have a little question. In GDI API were functions
GetWindowOrg/SetWindowOrg (if my memory is well) which were setting a
particular window original position and help to prevent such as mine
situation. Is in GDI+/.NET platform any way do change window origin point?
Thanks for any ideas.

--
dariusz rajtak

"Marcin Grzębski" wrote:
Hi Dariusz,

There is a "DockPadding" property of "ScrollableControl".
You can define it for dock offset.

Cheers!

Marcin
Hello,

I have to create my own control which might be an extension for a standard
'panel' control. I called it 'SmartPanel'. This is specialized panel. It
consists of a title bar and a client area on which other controls can be
placed. Depends on its state, it can shrink into one of its borders so only
title bar is visible in shrinked state. Problem is as follows: I want to be a
title bar with name of panel (e.g "Tools") and I paint it in a OnPaint event.
It is all ok, but when I put on my panel some other control (e.g other Panel
or Button) and when I set its Docking style (e.g to DockStyle.Right) its
covering title bar of my SmartPanel! I tried to figure out what's going on. I
found ClientSize property. Fine, but I can't use in when my SmartPanel is in
state 'dock to left' or 'dock to bottom' because of title bar is at beginning
of client area. ClientRectangle property is read only and in MSDN is written
that "the coordinates of the upper-left corner of the rectangle returned by
this property are (0,0)", but I want to upper-left corner starts at (0, 20)
for example. Please help me to solve this setting me mad problem...

thanks for advance.

Nov 16 '05 #3
Hi,

I don't have any experiences with Windows GDI.
So, I'm not sure what you mean as "Origin point".

But you can look for: "Control.CreateParams"
& "Form.StartPosition".

Cheers/Pozdrowienia

Marcin
Thanks for Your answer, it realy workarounds my problem. Code is nice and
works but I still have a little question. In GDI API were functions
GetWindowOrg/SetWindowOrg (if my memory is well) which were setting a
particular window original position and help to prevent such as mine
situation. Is in GDI+/.NET platform any way do change window origin point?
Thanks for any ideas.

--
dariusz rajtak

"Marcin Grzębski" wrote:

Hi Dariusz,

There is a "DockPadding" property of "ScrollableControl".
You can define it for dock offset.

Cheers!

Marcin

Hello,

I have to create my own control which might be an extension for a standard
'panel' control. I called it 'SmartPanel'. This is specialized panel. It
consists of a title bar and a client area on which other controls can be
placed. Depends on its state, it can shrink into one of its borders so only
title bar is visible in shrinked state. Problem is as follows: I want to be a
title bar with name of panel (e.g "Tools") and I paint it in a OnPaint event.
It is all ok, but when I put on my panel some other control (e.g other Panel
or Button) and when I set its Docking style (e.g to DockStyle.Right) its
covering title bar of my SmartPanel! I tried to figure out what's going on. I
found ClientSize property. Fine, but I can't use in when my SmartPanel is in
state 'dock to left' or 'dock to bottom' because of title bar is at beginning
of client area. ClientRectangle property is read only and in MSDN is written
that "the coordinates of the upper-left corner of the rectangle returned by
this property are (0,0)", but I want to upper-left corner starts at (0, 20)
for example. Please help me to solve this setting me mad problem...

thanks for advance.

Nov 16 '05 #4

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

Similar topics

1
by: Rhy Mednick | last post by:
I'm creating a custom control (inherited from UserControl) that is displayed by other controls on the form. I would like for the control to disappear when the user clicks outside my control the...
2
by: anand | last post by:
Hi all, I have created a custom control which displays Image using Graphics.. I am using this control in a different windows application. I am dynamically creating the control and putting that...
6
by: Robin Bonin | last post by:
In my user contol I am creating a set of dropdownlists. Each list is created based on input from the other lists. The problem I am having is setting the selected index on the lists. If someone...
3
by: Calvin Lai | last post by:
Hi all, I have a problem in creating web user control *programatically*. Problem as follows: 1. WebUserControl1 contains a server side table named Table1 2. WebForm1 contain a server panel...
2
by: Richard Lionheart | last post by:
Hi All, I generated a WebForm and created a Virtual Directory for it IIS. But I got an error message (shown below) saying something like my app lacked appropriate privileges. David Wang...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
13
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that...
2
by: JJ | last post by:
Using asp.net 1.1 I am trying to have a consistent look for the webcontrols. Right now, every time I use textbox controls, I manually change the font property, size property, and other property...
14
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms and retain the data users have entered. I thought...
8
by: Daveo | last post by:
Dear all, We recently migrated a SQL database from one server to another. Now, when you try to run some code in an Access Database which links to the SQL one, you get a 3704 error "Operation is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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
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,...
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.