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

Outside of the client region!

Hi folks,
Consider a visual component that's being derived from Control, say
MyCustomControl. This is opened-up whenever the user clicks a given
button in the toolbar. How am I supposed to open up this control
outside the ClientRectangle bounds?

Any help would be highly appreciated,

Cheers,
Mehdi

Feb 24 '07 #1
3 1653
Hello mehdi,
>Consider a visual component that's being derived from Control, say
MyCustomControl. This is opened-up whenever the user clicks a given
button in the toolbar. How am I supposed to open up this control
outside the ClientRectangle bounds?
Interesting way of phrasing that question... to be precise, I think you're
not supposed to do that at all.

Taking your question less literally, the reason why a simple Control
derived control will not be shown outside its parent container is because
it's not marked as being a top-level window. You could go and insert this
line in your control's constructor:

SetTopLevel(true);

Then you should be able to show the control outside any container - just
don't give it a Parent and call Show().

Of course there are certain drawbacks in this simple example - for
instance, the control will probably get a window border. It would depend
on your situation how you'd best proceed.
Oliver Sturm
--
http://www.sturmnet.org/blog
Feb 24 '07 #2
On Feb 24, 9:43 pm, "Oliver Sturm" <oli...@sturmnet.orgwrote:
Hello mehdi,
Consider a visual component that's being derived from Control, say
MyCustomControl. This is opened-up whenever the user clicks a given
button in the toolbar. How am I supposed to open up this control
outside the ClientRectangle bounds?

Interesting way of phrasing that question... to be precise, I think you're
not supposed to do that at all.

Taking your question less literally, the reason why a simple Control
derived control will not be shown outside its parent container is because
it's not marked as being a top-level window. You could go and insert this
line in your control's constructor:

SetTopLevel(true);

Then you should be able to show the control outside any container - just
don't give it a Parent and call Show().

Of course there are certain drawbacks in this simple example - for
instance, the control will probably get a window border. It would depend
on your situation how you'd best proceed.

Oliver Sturm
--http://www.sturmnet.org/blog
Well, would you please let me know how the menu bars are drawn outside
of the client region of a given program, without being a top-level
window??? Resize the notepad so that you can only see the menu bar.
Then click on "File" menu.... and you'll see that the menu will be
painted outside of the client region of the notepad. How this can be
possible?

Thank you for your time,
Mehdi

Feb 25 '07 #3
"mehdi" <me***********@gmail.comwrites:
Well, would you please let me know how the menu bars are drawn outside
of the client region of a given program, without being a top-level
window??? Resize the notepad so that you can only see the menu bar.
Then click on "File" menu.... and you'll see that the menu will be
painted outside of the client region of the notepad. How this can be
possible?
Because the menu is in fact a window with a special Window-Class.

Best regards,
Martin
Feb 26 '07 #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...
4
by: Barb | last post by:
I have a user control as my Save button for my page. When the Save button is clicked, I want some client-side validation to take place from a javascript function in the page, and then I'd like the...
4
by: dynastar | last post by:
I'm trying to send custom COMExceptions from my C# server. My test client in C# has no problem reading the HRESULT I send (say, 0x80040002). Needless to say, the MFC client in C++ allows this...
27
by: lovecreatesbea... | last post by:
This code snippet is an exercise on allocating two dimension array dynamically. Though this one is trivial, is it a correct one? Furthermore, when I tried to make these changes to the original...
2
by: Sagaert Johan | last post by:
Hi I want to draw grips around my usercontrol. Becorse the grips are around the customcontrol they are outside the controls drawing area. I tried setting the Region to infinit but that does not...
3
by: KBJ | last post by:
Hi, How can I get IP address of client, which sends request to server via .net remoting? Regards, Kate
5
by: =?Utf-8?B?TWFyaw==?= | last post by:
I'm researching what is the best way to create a generic WCF proxy wrapper that has the following requirements: 1. Remove the System.ServiceModel config section requirement for clients. We have...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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?
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
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,...

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.