|
Dr. GUI on MSDN had an article some time back that presented a pretty easy way of doing it: http://msdn.microsoft.com/library/en-us/dnaskdr/html/askgui11062001.asp[^].
You should also check out the articles here on CodeProject by searching the site. There has been several articles discussing other ways or even providing libraries if you don't want to write your own.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
So, there is no easy way to enable the XP styles for the menus like you can for the controls? Fooie!
Larry J. Siddens
|
|
|
|
|
XP visual styles have nothing to do with bitmaps on menu items. They are entirely independent of each other. You asked about menu item bitmaps - not XP visual styles.
I have written an article on XP visual styles here: http://www.codeproject.com/csharp/dotnetvisualstyles.asp[^]
If you are using .NET 1.1 or higher, you can also call Application.EnableVisualStyles() before you call Application.Run in your entry point method (Main ). That's also mentioned in the article forum for the article link I gave you above.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
You could use the Magic Library. It has Windox XP style menu components. You can get it on the code project site.
|
|
|
|
|
The user is going to be able to move listbox items up and down in the listbox. I want to use two buttons with upp-and-down arrows. Like the characters < and > but rotate them så they point up or down instead
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
So what's the problem? You want to know how to do it?
Either make a couple of images and use them on a couple of Button objects, or set the Font for the Button objects to Wingdings or something and choose the appropriate character for an up or down button (there are several). Use the Character Map application in Windows to help find which one is appropriate (Start->Programs->Accessories->System Tools->Character Map).
Using images as embedded resources in the dialogs you see with up/down arrows is what the .NET BCL uses, but either way works. Using a font to do it will also allow the arrows to match the system's current ControlText color.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
Either make a couple of images and use them on a couple of Button objects, or set the Font for the Button objects to Wingdings or something and choose the appropriate character for an up or down button (there are several). Use the Character Map application in Windows to help find which one is appropriate (Start->Programs->Accessories->System Tools->Character Map).
doh...
Thanks, I didn't think that far.
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
|
|
|
|
|
In my app I want to create some tool windows, which can be auto-hide and docking like that tool windows of VS.net, with VC++.net. But I looked the MSDN and some samples, the tool window is like only to be created as addin to be used by other app. Please tell me how to do, thank you very much.
If you have some samples , could you send to me?
|
|
|
|
|
There's plenty of samples in this site, though most are in C#. If you truly understand .NET, however, you won't have any trouble translating this code to VC++.NET, because they all have equal access to the .NET base class library (BCL), or any other assembly for that matter.
Also, this is the C# forum. This question would've been more appropriate in the Managed C++ forum.
There are also existing libraries that do this, including a decently-priced commercial one developed by one of CodeProject's members, Phil Wright, at http://www.dotnetmagic.com[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
you can go to http://www.csdn.net and to search it that you want
|
|
|
|
|
Hi out there!
Anyone having a suggestion why this code doesn't work?
The transformer doesn't seem to interpret xsl.
<br />
XslTransform xslt = new XslTransform();<br />
xslt.Load(this.xslFile);<br />
<br />
XPathDocument mydata = new XPathDocument(this.xmlfile);<br />
<br />
StreamWriter sw = new StreamWriter(this.outFile);<br />
XmlWriter writer = new XmlTextWriter(sw);<br />
<br />
xslt.Transform(mydata, null, writer, null);<br />
<br />
<br />
writer.Close();<br />
Help appreciated a lot.
|
|
|
|
|
The code looks fine - your XSLT is probably wrong. Make sure you use XPath expressions in your XSLT document that use a namespace prefix assigned to the same namespace as the namespace-qualified elements and attributes in your XML document.
You can test to make sure it is correct by adding <?xml-stylesheet href="yourxsltfile.xslt" type="text/xsl"> to the top of your XML document, where "yourxsltfile.xslt" is an absolute or relative path to your XSLT document. Then open the XML document in Internet Explorer and see if you get what you want.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
how we can use winapi methods in c#
regards' Amir Jalaly
|
|
|
|
|
Nick Seng already gave you a helpful link below. P/Invoke uses the DllImportAttribute on external function declarations. You should read the SDK documentation for the System.Runtime.InteropServices namespace elements, include the MarshalAsAttribute which helps the framework marshal parameters (when necessary) for native functions and COM interop.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
How we can shut down the computer programically?
or Log off?
Regards' Amir Jalaly
|
|
|
|
|
ExitWindowsEx WinAPI function
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
|
|
|
|
|
I can not find this method and when i write method name in code i recieved compile error
Regards' Amir JAlaly
|
|
|
|
|
It's a function in the User32.lib API. Use P/Invoke to call this function from a C# Application.
Read more about P/Invoke here[^]
and ExitWindowsEx here[^]
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
|
|
|
|
|
Hi, All.
I have a question about comparing the contents of ArrayList.
I use an arraylist to store up some strings, and the that arraylist is stored inside a new arraylist.
e.g.
ArrayList final= new ArrayList();
//--- loop ---//
ArrayList str = new ArrayList();
str.Add("xxx"); // storing string
str.Add("yyy");
.....
final.Add(str);
//-------------//
The "final" arraylist collects all "str" arraylist, and now I want to check whether the "final" contains one arrayList. It seems doesn't work, am I do it worng??
I use :
if(final.Contains(newstr)) // newstr is a new created arraylist
{
// do something here....
}
Please help~~
|
|
|
|
|
Have you added newStr into final yet? If not, your expression will return false.
ArrayList.Contains function will only return true if you pass in the reference of an object that is within the arraylist. For example, if your code had been written like so:
....
ArrayList tempRef = str;
final.Add(str);
....
the expression final.Contains(tempRef) would return true.
HTH.
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
|
|
|
|
|
I don't know why still does work ?
in my program:
I store create an arraylist to store up the some string of ListView item data, and I assign that arraylist as ListViewItem.Tag
Finally, when I multiple selected the ListViewItem, I use a new ArrayList called "Final" to collect selected Item.Tag:
for(int i=0; i< List.Items.Count; i++)
{
Final.Add( (ArrayList) List.Items[i].Tag );
}
I want to check if "Final" contains any Tags new ListView;
ArrayList selectedItems = Final;
if(selectedItems.Contains(Items[i].Tag))
Items[i].BackColor = Color.Orange;
I have used debug window to check, they contains same data inside actually, but seems wrong data type; the selectedItems only shows that it contains "system.object", however, Items[i].Tag contains "System.Collections.ArrayList"??
Is it a mistake that I made?
Please help ~~ Thank you
|
|
|
|
|
First of all, some suggestions.
this line:
Final.Add( (ArrayList) List.Items[i].Tag );
Don't bother casting the Tag object to arraylist as ArrayList Items are of the System.Object Class. What you are doing is casting from Object to Arraylist, and then back to object.
azusakt wrote:
I want to check if "Final" contains any Tags new ListView;
I'm not sure I understand this sentence. Do you mean that the you now have a different ListView? If so, you should remember that ArrayList.Contains checks for reference, not values. For example:
a.Add("123");
b.Add("123");
c.Add(a);
The expression c.Contains(b) would return false even thought a and b contains the same value, just because a and b not the same reference.
I hope I'm not confusing you
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
|
|
|
|
|
Hello,
I want to focus a perticular cell in a datagrid control. Its not a difficult task, but i don't want to surf my time, so if anyone knows this thing, please reply soon.
Thanks.
|
|
|
|
|
So you think posting a simple question to the forums is faster than looking at the properties and methods for the DataGrid class? DataGrid.CurrentCell should stick out like a sore thumb.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello,
Infact, i already tried it. But, its not focusing on a perticular cell when i do this,
DataGrid.CurrentCell.RowNumber = RowNumber;
DataGrid.CurrentCell.ColumnNumber = ColumnNumber;
It gives me an exception. I want to focus a perticular cell during runtime.
|
|
|
|