|
Hi all,
I've got a little question about system colours and xp themes.
Most objects in windows xp change colour when you change theme. In the .Net framework you have the SystemColors enumeration which you can use for objects to be appropriatly coloured with each theme.
However, i've noticed there are some colours that aren't represented in this enumeration. For example, if you right click on a folder and go to properties, then to the customize tab, there are several group boxes with text on them. In the xp-default and silver color schemes, the text is blue, but change back to windows classic theme, and the text is black.
I've checked every system colour in the enumeration, and not a single colour is blue in both the xp-default scheme and the silver scheme.
I've looked around on google but can't find anything relating to this. Does anyone know what colours Windows is using. Obviously, i've considered the option of manually defining the colours, and altering them when the user changes the colour scheme, but there must be a simpler way than this.
Simon
|
|
|
|
|
Simon Stevens wrote: Does anyone know what colours Windows is using.
You should be able to do a print screen and use a program like Paint Shop Pro or Photoshop to get the specific color of the pixels in the text.
It sounds like you may have to manually alter the colors used, I believe you can listen in on theme change events in Windows XP to tell when a theme has changed.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Yeah, I figured I was going to have to do something ugly like that.
Thanks tho.
Simon
|
|
|
|
|
Visual themes are a different sort of beast. There are themes installed on your system that define way more categories of representations than SystemColors , and if you want to use themes you have to owner-draw these on your controls yourself. .NET 2.0 makes this fairly easy for controls in the base class library (BCL). For your Windows Forms application's entry point, use the Application.EnableVisualStyles() method like so:
class Application
{
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.DoEvents();
Application.Run(new MainForm());
}
} If you want to draw themed text, borders, etc., on your owner-drawn controls, read Rendering Controls with Visual Styles[^] and Custom Control Painting and Rendering[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Cheers, that really helps.
Simon
|
|
|
|
|
I am facing a very rigid problem. Project requirement is to integrate NUNIT with Crystal Reports and then write NUNIT Test cases for each Crystal reports designed... Please help me in integrating NUNIT with Crystal Reports And afterwards in writing NUNITs for the same
Harshal M Nemade
|
|
|
|
|
how to use a WMI Provider to monitor chat application...
how to insert a Provider in chat application...
kim
|
|
|
|
|
|
Hello All:
I was able to create a package .EXE & MSI. But on the installer I want to add some checking on the target machine if it has .NET Frame work install or not. If target machine had .Net Framework install skip,and if it does not have .Net Framework then install it. Please help
Thanks in advance.
Eyungwah
|
|
|
|
|
Try using NSIS. It's a scripting system used and developed by the winamp team.
company, work and everything else @ netis
|
|
|
|
|
Hello!
Im trying to write a deployment project in VS.net 2005.
What Im trying to do is this.
Take the target installation path and write this string value to the registry.
I just cant figure out how to do this. I know how to write to the registry, but somehow I need to get the target path and write this parameter to the registry.
Very thankfull for any help.
|
|
|
|
|
The VS deployment projects aren't very flexible. You might be better off using WiX[^]. That said, you can use [TARGETDIR] for your registry value in most cases. If you're trying to write the exact location of a file you can use the notation [#filekey] but that where things get difficult, since the VS.NET deployment projects don't show you the component, file, registry, etc. key names (the deployment projects compile into .msi files, which are relational databases processed by Windows Installer).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello!
Thanks for your answer!
I found out [TARGETDIR] right after I posted
What is WiX and where can I find it?
Best regards!
|
|
|
|
|
|
It looks promissing I must say!
Does this integrate into VS.net?
|
|
|
|
|
If you create your own project installer (System.Configuration.Install.Installer), you can easily get the install path by just using reflection on the executing assembly. Here is some code I use to do this in my installer:
System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly();
string baseAppDir = (new System.IO.FileInfo( asm.Location )).DirectoryName;
RegistryKey softwareKey = Microsoft.Win32.Registry.LocalMachine
.OpenSubKey( "Software", true )
.OpenSubKey( "Company Name", true )
.OpenSubKey( "Application Name", true );
softwareKey.SetValue( "InstallLocation", configFilepath );
Keep in mind that I added a registry value in setup project that creates the HKLM\Software\Company Name\Application Name\InstallLocation key with some default or empty value. The setup project actually creates the keys you specified in the registry editor part of the setup project before it calls your code in the Installer class.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
hi,
how i can apply transaction on a dataset ?
|
|
|
|
|
neerajxp wrote: how i can apply transaction on a dataset ?
A dataset is a disconnected set of data. There is nothing to transact against.
|
|
|
|
|
I have successfully used binary remoting with an object containing generic signatures on its public methods on XP development machines.
I am trying to implement the client web site and the serving remoting site on a Windows 2003 server.
I am finding that methods without generics work fine, but ones with generics are failing.
There appears to be a problem with handling the declared class instance as T. Again, on an XP machine this works fine.
Here is an excerpt from my remoting web config.
"
<system.runtime.remoting>
<customerrors mode="Off">
<application>
<channels>
<channel ref="http">
<serverproviders>
<formatter ref="binary">
<service>
<wellknown mode="Singleton" type="MyApp.DataServices.DataService, MyApp.DataServices" objecturi="DataService.rem">
"
Here is an excerpt from the web client web config
"
<system.runtime.remoting>
<application>
<client>
<wellknown url="http://localhost:##/MyRemotingVirtualDirectory/dataservice.rem" type="MyApp.DataServices.Interfaces.IDataService, MyApp.DataServices.Interfaces">
<channels>
<channel ref="http" usedefaultcredentials="true">
<clientproviders>
<formatter ref="binary">
"
Here is the code that makes the remoting call
"
IDataService obj = RemotingServices.Connect(typeof(IDataService),
ConfigurationManager.AppSettings[WebConfigContants.REMOTINGSERVERURL]) as IDataService;
"
The exception I get back on the web site client is to the effect
"
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.Remoting.RemotingException: The argument type 'MyDomain.MyDomainClass' cannot be converted into parameter type 'T'.
at System.Runtime.Remoting.Messaging.Message.SoapCoerceArg(Object value, Type pt, Hashtable keyToNamespaceTable)
at System.Runtime.Remoting.Messaging.MethodCall.SetObjectFromSoapData(SerializationInfo info)
at System.Runtime.Remoting.Messaging.MethodCall.SetObjectData(SerializationInfo info, StreamingContext context)
at System.Runtime.Remoting.Messaging.MethodCall.RootSetObjectData(SerializationInfo info, StreamingContext ctx)
at System.Runtime.Remoting.Messaging.SerializationMonkey..ctor(SerializationInfo info, StreamingContext ctx)
--- End of inner exception stack trace ---
Server stack trace:
at System.RuntimeMethodHandle._SerializationInvoke(Object target, SignatureStruct& declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.RuntimeMethodHandle.SerializationInvoke(Object target, SignatureStruct declaringTypeSig, SerializationInfo info, StreamingContext context)
at System.Reflection.RuntimeConstructorInfo.SerializationInvoke(Object target, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
at System.Runtime.Serialization.ObjectManager.DoFixups()
at System.Runtime.Serialization.Formatters.Soap.ObjectReader.Deserialize(HeaderHandler handler, ISerParser serParser)
at System.Runtime.Serialization.Formatters.Soap.SoapFormatter.Deserialize(Stream serializationStream, HeaderHandler handler)
at System.Runtime.Remoting.Channels.CoreChannel.DeserializeSoapRequestMessage(Stream inputStream, Header[] h, Boolean bStrictBinding, TypeFilterLevel securityLevel)
at System.Runtime.Remoting.Channels.SoapServerFormatterSink.ProcessMessage(IServerChannelSinkStack sinkStack, IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream, IMessage& responseMsg, ITransportHeaders& responseHeaders, Stream& responseStream)
"
Any suggestions would be most welcomed.
Luke Hammond
|
|
|
|
|
Remoting web config should read
<system.runtime.remoting>
<customerrors mode="Off">
<application>
<channels>
<channel ref="http">
<serverproviders>
<formatter ref="binary">
<service>
<wellknown mode="Singleton" type="MyApp.DataServices.DataService, MyApp.DataServices" objecturi="DataService.rem">
Client web site config should read
<system.runtime.remoting>
<application>
<client>
<wellknown url="http://localhost:##/MyRemotingVirtualDirectory/dataservice.rem" type="MyApp.DataServices.Interfaces.IDataService, MyApp.DataServices.Interfaces">
<channels>
<channel ref="http" usedefaultcredentials="true">
<clientproviders>
<formatter ref="binary">
|
|
|
|
|
O.K. I need to use preview and figure out what is happening to my text
Here is the remoting config
system.runtime.remoting
customErrors mode="Off"/
application
channels
channel ref="http"/
serverProviders
formatter ref="binary"/
/serverProviders
/channels
service
wellknown mode="Singleton" type="MyApp.DataServices.DataService, MyApp.DataServices" objectUri="DataService.rem"/
/service
/application
/system.runtime.remoting
And here is the web site client config
system.runtime.remoting
application
client
wellknown url="http://localhost:##/MyRemotingVirtualDirectory/dataservice.rem" type="MyApp.DataServices.Interfaces.IDataService, MyApp.DataServices.Interfaces"/
/client
channels
channel ref="http" useDefaultCredentials="true"
clientProviders
formatter ref="binary"/
/clientProviders
/channel
/channels
/application
/system.runtime.remoting
|
|
|
|
|
Hi all,
I have to make a application for synchronous and Asynchronous socket communication so right now i am able to Asynchronous socket by AsyncCallback
function but i am unable to synchronous socket so please tell how can i cretae synchronous socket in .net framwork.
if any body have idea please share with me.
thanks
bankey
|
|
|
|
|
I have a requirement to draw a rectangle and a line on a the
container control and sometimes as i move the mouse the drawing must
occur on top of user controls and other controls, which are placed in
the container control...
I'm using System.Drawing namespace (C#) to perform the drawing.
But as i move the mouse and draw the rectangles, the drawing takes
place behind the user controls....I have a requirement to draw the
shapes on top of the controls...
Please helppppppp
|
|
|
|
|
The controls will always be drawn on top of your rectangle because your drawing on the container the controls are in.
What you need to do is draw on the controls themselves when appropriate.
You can do this by handling the controls paint event.
Simon
|
|
|
|
|
I can call JavaScript functions from my C# dll, but I was hoping I could send information via function calls from the javascript back to me C# dll.
I can not find anyway to do this. Please let me know where this information would be at in this great web of ours.
Thanks
|
|
|
|