|
Visual Studio has the nifty-looking selection colors when you hover over the main menu. I am in the process of writing a custom control, and I would like to use those colors (Windows Theme-depended obviously) for the selection mechanism in my custom control.
It seems System.Drawing.SystemColors isn't the proper way to get them; I can't find a SystemColor that is the correct color across all Windows Theme skins; for example, using the standard Blue Luna theme, SystemColors.InactiveCaptionText is the correct color for the internal region of the selection. However, using the Olive theme, that is not the correct color.
How can I get the correct colors needed to draw a VS-style selection?
Thanks ahead of time.
The graveyards are filled with indispensible men.
|
|
|
|
|
Sometimes Microsoft changes the normal colors of a control by changing the RGB components, like adding the difference between the current color and FF (for each component). This will lighten the color. There are also SystemColors that should already have such values, too, like ControlLight and ControlLightLight . You could try these as well.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
|
I wrote a program to go through all the SystemColors and compare them with what Visual Studio uses. The result was that there were some colors that Visual Studio uses (for instace, to draw a Visual Studio menu using the Luna Blue theme, SystemColors.Highlight can be used for the outer border, and SystemColors.InactiveCaptionText can be used for the inner region). However, if I switch themes, say to the Olive theme, SystemColors.Highlight and SystemColors.InactiveCaptionText no longer are the correct colors. In addition to checking all the SystemColors , I've also check through all system colors put through ControlPaint.Dark , .DarkDark , .Light , and .LightLight and still haven't found the correct colors!
Ack.
The graveyards are filled with indispensible men.
|
|
|
|
|
As I mentioned before, another thing they sometimes do is modify the RGB components of the color to get such an effect (adding to lighten, subtracting to darken). You could do the same thing if the SystemColors don't work for you.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Does anyone know how to programmatically position the mouse on a control in c#?
Darryl Borden
Principal IT Analyst
darryl.borden@elpaso.com
|
|
|
|
|
Cursor.Position = somePoint;
If you want to limit that point to be on the control, use the control's .PointToClient method. For example,
Point somePoint = new Point(0,0);
Cursor.Position = myControl.PointToClient(somePoint);
The graveyards are filled with indispensible men.
|
|
|
|
|
I am new to .NET. I have 1 solution with 2 projects. Project 2 compiles into a class library which is reference from Project 1. I wish to walk into the source of my reference during debug. Can I do this? BTW, both projects are set to debug...
Thanks
Ralph
|
|
|
|
|
Should work just fine...just set your break points and launch it.
|
|
|
|
|
Thanks but it doesn't. So here is a bit more info. Project 1 is a ASP.NET application, so I lauch a web page. I wish to trace into the method that is in the reference. So if I CAN'T trace into the method, what should I check...
Thanks
Ralph
|
|
|
|
|
Debugging has to be enabled on the server. In IIS, you can configure this in the Application Configuration. The .NET Framework debugging tools (from the SDK) also have to be installed (from what I've read), so install the SDK on the server (not just the runtime).
There is a lot of documentation on this in the KB at http://support.microsoft.com[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks for all the help. I realized (later) that these were stubs, RPC calls to the server...
|
|
|
|
|
hi all
I want to trace the parallel port & serial port
thanks;)
|
|
|
|
|
|
|
|
if u mean to read and send data to ports there are numbers of ways.
for parallel port u can use outport and inport commands.
for serial port it is little more difficult. there are number of article in codeproject itself
|
|
|
|
|
how do i specify the build order of the projects in a solution? for example, if i have a deployment project in a solution, how do i make that build last, so the deployment project will include the latest versions of the assemblies?
|
|
|
|
|
godzooky wrote:
for example, if i have a deployment project in a solution, how do i make that build last, so the deployment project will include the latest versions of the assemblies?
The projects are built based on reference dependency. This is why you can't have circular references in your projects. You're deployment project should reference the projects on which it depends, and therefore will be built last.
Marc
Latest AAL Article
My blog
Join my forum!
|
|
|
|
|
Hi,
I'm new to the windows datagrid control. I'm trying to create an application that displays the contents on an access database. I've got that part working so far; my question is how can I have the datagrid & access database accept any changes that the user enters into the datagrid. Is their a way for the datagrid's contents to be dumped into the access database after a change is made? I don't want to do it manually, it could get messy.
Thanks
|
|
|
|
|
You have to take look at htese class:
Use a OleDbDataADapter to fill a DataSet and bind it to DataGrid , then each change reflected to datagrid, you can update access database with OleDBdDataAdapter.Update() method. If you search for these classes you can find samples in this site and MSDN.
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
Hi Mazy,
I have a datagrid in win form that when a change to a record on that same form occurs how can I get the datagrid to refresh with new updates?
I have the datagrid bound to a dataview. So some how need way to update the dataview I'm guessing.
Thanks,
JJ
|
|
|
|
|
MrJJKoolJ wrote:
I have the datagrid bound to a dataview. So some how need way to update the dataview I'm
I told you how to do this. The dataview only for VIEW, you bind it to datagrid and when something change in datagrid it reflected in dataview automaticly.
MrJJKoolJ wrote:
can I get the datagrid to refresh with new updates?
You don't need to do that, as I told you , yu made change in DataSet, then it AUTOMATICLLY it is reflected in your datagrid.
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|
|
Thats my problem Mazy, I change some field that isn't in grid but on same form and it isn't bound. But it updates the same dataset. I click on Update button and changes to db are updated but grid doesn't update at all. I even tried refreshing grid to no avail !
JJ
|
|
|
|
|
The nature of daragrid is for binding to dataset and other than that is nor very well scenario. But if you want to update datagrid independently, you can do it like this:
datagrid[rowindex,columnindex] = value;
Mazy
"Improvisation is the touchstone of wit." - Molière
|
|
|
|