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

Control in non-client area of form

How do I put a control on the non-client area of a form?

Can a component be painted onto the non-client area? (Bounds)
Dec 27 '08 #1
10 7190
tlhintoq
3,525 Expert 2GB
@peepoohead7
Google is your friend:

This looks like what I think you are wanting.
Dec 27 '08 #2
They put it onto the non-client area of the form, and nothing looks wrong different with microsoft office (word, excel, powerpoint) or the codejock sample I got. So how did they put the control onto the non-client area of the form?
Dec 27 '08 #3
tlhintoq
3,525 Expert 2GB
Was the answer to your question first time you asked not what you were looking for?

You really should keep to one thread per question.
Dec 28 '08 #4
It works, but when I put text box onto the control and type into it, anything's thats colored black will become transparent. And maximizing / restoring the window messes it up (although I'll try to solve that). So how do I not let the black color on the controls turn transparent?
Dec 28 '08 #5
tlhintoq
3,525 Expert 2GB
@peepoohead7

Set the text color to something other than black?

Use the resize (SizeChanged, SizeChangedComplete, etc) events to relocate the text box.
Dec 29 '08 #6
Plater
7,872 Expert 4TB
MERGED.
Please don't double post.
MODERATOR


You want a textbox in the title bar? Interesting.
I would have just turned off the border/titlebar and made my own at that point i think.
Is there a picture/screenshot of what you are trying to do, that link only showed a colored titlebar,which i have also never seen really.
Dec 29 '08 #7
Here are some examples of what I'm trying to do:

This

and This.

Only Windows Vista can paint those windows, but somehow they got the orb and the toolbar onto the title bar. Tlhintoq, your link was what I was looking for, except for the problem I described previously. I'll do some more searching.
Dec 29 '08 #8
Plater
7,872 Expert 4TB
Oh so its a vista thing, no wonder i had never seen it
Dec 29 '08 #9
I read in this article that:

Office completely removes the non-client area, and renders everything in its client area, so it doesn't have a caption (except a fake one).

Notice how the glow and the text are different, it's because they're not rendered by the DWM.
I compared the pixels on the top left corner of Word and a program (same location, same size, same background) and it was a bit different.

If I set the text to a different color the text will still appear transparent :(
Dec 29 '08 #10
I got it! Using the link you gave me, I overrid the WndProc property like this:

Expand|Select|Wrap|Line Numbers
  1. protected override void WndProc(ref Message m)
  2.         {
  3.             if (m.Msg == 0x83)
  4.             {
  5.                 Point point = new Point(m.LParam.ToInt32());
  6.                 m.Result = new IntPtr(-1);
  7.                 return;
  8.             }
  9.  
  10.             Graphics g = Graphics.FromHwnd(Handle);
  11.             g.DrawString("String",
  12.                 new Font("Lucida Console", 10f),
  13.                 new SolidBrush(Color.Black),
  14.                 PointF.Empty);
  15.  
  16.             base.WndProc(ref m);
  17.         }
Now all I have to do is to remake the buttons and resizing.
Thanks for your help. :)
Dec 30 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Dave Lambert | last post by:
Hi, Hope someone can answer this, is it possible to have some dates that the user is unable to select in the Calendar, I am using the dayrender event to highlight specific dates, but would like to...
5
by: Miyra | last post by:
Hi. I'm working with an app that uses exceptions for control flow. These are code blocks where exceptions are thrown/caught regularly. A couple hundred exceptions occur per hour and they're caught...
4
by: lwickland | last post by:
Non-visual C# objects on a webpage are not marked as "safe for scripting" I'm developing .NET components in C# which are used as ActiveX-style controls on web pages that are displayed inside a...
5
by: Konrad | last post by:
Hi, How to make a ListBox control non selectable? I could't find any property to do it. Regards, Konrad
1
by: None | last post by:
Hello In order to host and use an ActiveX control (non-GUI) in a WTL app, I followed the following steps: 1. During project creation, the ActiveX Hosting option is enabled. 2. In the dialog...
1
by: Paul Kia | last post by:
I have an ATL composite control which I drop into a tab control dialog page of an MFC application. When I click on the composite control and then click anywhere outside the MFC application, the...
399
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post by:
PEP 1 specifies that PEP authors need to collect feedback from the community. As the author of PEP 3131, I'd like to encourage comments to the PEP included below, either here (comp.lang.python), or...
12
by: rafalK | last post by:
Hi All, I have a big problem with STAThread attribute. I'm using XNA framework connected with WinForms. XNA is working in non STAThread. I have a problem with displaying CommonDialog forms e.g....
5
by: =?Utf-8?B?V29ua28gdGhlIFNhbmU=?= | last post by:
Hello, I have a custom control (not a listbox or other hierarchical or list control) that I would like to bind to a specific row and column from a DataTable. Each row of the datatable will...
0
by: biswal.srikant | last post by:
I've been trying to correct this error for approx 2 days and am having no luck. In a page's button clickevent , i want to bind a infragistic grid according to two dropdown value. At the first...
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
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
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
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...
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.