|
Not without installing a bunch of Windows .DLL's that only come with Windows XP...
On top of that, they will only work on Windows XP.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
HI,
You mean there is no way to add XP Look for an application Running on a Non XP machine.
Omar Rehman
|
|
|
|
|
There are many articles about owner-drawing buttons and other controls both here on CodeProject and around the 'net. Try searching this site or using google.
This isn't XP themes, however. The theming API is only available in Windows XP and newer, and the common controls library that supports themes is only available for Windows XP and newer. This is covered in the Theme API documentation.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hai there,
what is the status of Microsoft ObjectSpaces technology ?
********************
Sreejith S S Nair
Bangalore - India
91-0-9886501765
********************
|
|
|
|
|
Ask Google[^]
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Friends.
I have three Datasets to be populated to one Excel Workbook. but i need to populate each datasets in to one worksheet. So if i export the datasets to one excel file, sheet1 should have Dataset1 and Sheet2 should have dataset2 and so on.
PLEASE HELP ME WITH THIS.
|
|
|
|
|
Hi, does anyone know any way to find the length of a string that will be displayed using a proportional width font?
A proportional width font is one that displays letters at different widths e.g. i gets less pixels than G.
|
|
|
|
|
|
use Graphics.MeasureString(string, font)
This will return a SizeF object with the width of the string in pixels.
Kev Pearman MCP
|
|
|
|
|
|
Has anyone had to implement OLE containers under C#?
|
|
|
|
|
Hi,
I'm printing Form Controls (buttons,labels, textboxes and such).
I'm trying to set the left margin for the printing page, but it's not working.
The code to change to landscape works OK though... what's up?
private void menuPrint_Click(object sender, System.EventArgs e)
{
this.printDocument1.DefaultPageSettings.Margins.Left = 200;
this.printDocument1.DefaultPageSettings.Landscape = true;
this.printDocument1.Print();
}
thanks,
Ron
|
|
|
|
|
That code should set the left margin correctly but your problem might be in your printing code instead.
inside your print method how are you deciding where to print your objects?
printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)<br />
{<br />
e.Graphics.DrawRectangle(myPen, e.MarginBounds.Left, Y, Width, Height);<br />
}
I believe that would print a rectangle starting at the left hand margin of your printed page.
Hope it helps.
Kev Pearman MCP
|
|
|
|
|
Thanks Kev,
I'm new to programming and thought that margin would be added automatically to the control coordinate already given. I'll try something like this:
ControlPaint.DrawButton(g, t.Left + e.MarginBounds.Left, t.Top + e.MarginBounds.Top, t.Width, t.Height, ButtonState.Pushed );
Ron
|
|
|
|
|
Printing allows you to print in the page margins because Headers and Footers go into the margins.
Anyway, good luck with your printing.
Kev Pearman MCP
|
|
|
|
|
How to read a value from an address in memory using C#
|
|
|
|
|
I am developing a component that compiles code into a dynamic in-memory assembly (using CodeDOM). This in-memory assembly needs to run under restricted permissions, including limited access to the filesystem, but it also needs to have access to certain paths.
Now, I expect that the way to go about doing this is to make a code group, and a custom permission set to assign to that code group. However, I have some questions:
- How do I make the assembly run under the code group I've defined? I can't use a URL, as the dynamic code can come from numerous places. Nor can I use a hash (for obvious reasons). So I guess a strong name would be the best option.
- I'm wanting to allow the code to have read-only access to a certain directory. Since the directory path is determined at install time, how would I go about defining the FileIOPermission in the permission set XML file?
- How do I best go about ensuring that the code group is installed before the component executes the restricted code? (If the code group is not in place, the code may recieve more permissions than it ought to.)
Sorry if some of my questions sound stupid; I haven't dealt with more than just basic CAS before (although I've read all the MSDN docs I've found on the subject).
TIA
|
|
|
|
|
This is not my article, however, I would just like to draw the attention of the forum to the following article of an implementation of SPAM identification with a C# libary.
http://www.generation5.org/content/2004/KillSpam.asp
I hope that the code behind it does not in fact generate even more spam in some secretive way, however, what is said in the article makes a lot of sense.
|
|
|
|
|
I can connect to a remote registry using microsoft.win32 package.. but it only works if i have authentication.. and the only way i know how to get it is try to access the computer over the network and fill in the details:P how do i gain permission using c# code?
|
|
|
|
|
By default, the CurrentPrincipal on the thread is GenericPrincipal. If you set the CurrentPrincipal to WindowsPrincipal it should be the same as doing a RunAs. You can access the property off of the current thread (System.Threading.Thread.CurrentPrincipal). You can also set this at the AppDomain level, but you can only do this once during the entire life of the application domain. By doing it at the domain level, you inherit the WindowsPrincipal througout all threads within that application domain.
|
|
|
|
|
ok im not too familiar with CurrentPrincipal.. so could i plz have a code example to show me how to pass credentials to a remote computer to access their registry thanks
|
|
|
|
|
Getting credentials to see if a user is in a particular role is easy.
Passing credentials from one system to another to access registry information is not. If it was easy, we'd have one more security patch to be applied to Windows because it would be such an easy hack.
If there were a real business justification for doing something like this, then about the only way I could think of was to have the user install an agent and access the agent via remoting.
This signature left intentionally blank
|
|
|
|
|
Hi,
I am using two model dialog boxes named "StartUp" and "AddNewItem" from the main Form named "Form1" with the following code
frmStartUp = new StartUp();
frmStartUp.ShowDialog();
if (frmStartUp.DialogResult == DialogResult.OK)
{
// Doing Something
frmStartUp.Dispose();
}
else if(frmStartUp.DialogResult == DialogResult.Cancel)
{
frmStartUp.Dispose();
}
same is the code for the second dialog box (AddNewItem).
When i click on the Cancal button of the second dialog box it gives the following excpetion
An unhandled exception of type 'System.Runtime.InteropServices.SEHException' occurred in system.windows.forms.dll
Additional information: External component has thrown an exception.
whereas clicking the cancal button of the first dialog box (StartUp) does not give any exception.
what the problem with it.
Thanks in Advance
Omar Rehman
|
|
|
|
|
try this:
frmStartUp = new StartUp();
if (frmStartUp.ShowDialog == DialogResult.OK)
{
// Doing Something
frmStartUp.Dispose();
}
else
{
frmStartUp.Dispose();
}
|
|
|
|
|
Hello. I require some assistance in measuring an image. Currently I am able to measure a stadard line (horizontal, diagonal and vertical). Now, I would want to measure a non standard form. What I would want to do is to click from one point to another continuously and each clicked point will be assigned to a standard incremental node name (ex: A, B,..Z). Then, the software will record the coordinate of each nodes into a table. I really need sonebody;s help in this since I am rather new with this software. Thank you.
M
|
|
|
|