|
I create a MDI contain form, add a MainMenu, a ImageList, a ToolBar, and the ToolBar relate the ImageList.
When I use the function Application.EnableVisualStyles() to enable xp style, the toolbar icons are disappeared. But when I use instead of a manifest file, the toolbar icons display correct.
Is this a bug with .net framwork 1.1?
(I used VS.net2003 simplified chinese version)
=== Game is power! ===
|
|
|
|
|
Does anyone know if it is possible to give the ComboBox control a flat appearance? If not, do you know where I may find a flat combo box?
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Anything's possible (given time)!
Search for the author "Carlos H. Perez". He has some great flat controls available here on CP.
-----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:
He has...
He had...
|
|
|
|
|
Yeah, I noticed that just today. I remember him saying that he was moving everything new to a commercial library. Nice of him to pull the old stuff! Greedy bastard.
-----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-----
|
|
|
|
|
I can get the form's graphics with CreateGraphics(). But how can I get the title bar's graphics? or How to determine the title bar's retangle?
The wParam gotten from WM_NCPAINT always is 1.
|
|
|
|
|
Ok, I am trying to figure out the best way to do this. I have string representing an HTML page that I need to render and then save as a .jpg or .gif image. I currently use the IE control to preview the HTML page, but I need to be able to capture an image without previewing the document. Any pointers or ideas?
|
|
|
|
|
I'm currently working on a project where I need to scrape a web page for info.
Seems pretty simple far. The problem is that the site has a password protected front end. When you log in it takes you to a menu page. The data I want to scrape is on another inside the site.
The question is after making my initial webrequest and posting data to the stream, how to I navigate to another page and then do a request for it's data.
Thanks in advance
|
|
|
|
|
Are you using the WebClient class? Does the site use cookies to store session data? If so, make sure to set it up to receive those cookies.
|
|
|
|
|
I solved this.
I am using HttpWebRequest and HttpWebResponse. I created a CookieContainer to hold all the session stuff from the first request which is the login page.
I can now copy that Cookie container into the CookieContainer of any new request that I want to make on the site.
HttpWebRequest loginRequest = null;
HttpWebRequest secondPageRequest = null;
loginRequest = (HttpWebRequest)WebRequest.Create(loginURL);
secondPageRequest = (HttpWebRequest)WebRequest.Create(secondPageURL);
CookieContainer loginCookies = new CookieContainter();
loginCookies = loginRequest.CookieContainer;
secondPageRequest.CookieContainer = loginCookies;
Thanks
David
|
|
|
|
|
Heath Stewart kindly provided me with the code snippet below which works generally for exposing functionality that somebody's wrapper of a windows system control left out.
My question now is, how do i best integrate it with VS Designer? The textbook way is to create a new component TreeViewNoHScroll. I am then free to register the class in the designer toolbox etc. But that seems a bit heavy, adding my own Windows Forms control dll to the toolbox for every simple wrapper patch. At the other extreme, I could directly edit the designer code where it creates the new TreeView() and make it a new TreeViewNoHScroll, but I dont like to muck with designer generated code because i have a hard enough time replacing controls or properties that somehow get lost and dealing with other designer quirks and gremlins.
So, is there a way to dynamically create a TreeViewNoHScroll that inherits from the existing instance of a designed TreeView, before the window is created? Or to somehow use reflection to just replace the protected function in TreeView without even creating a new wrapper class?
What's the best way to fix the wrapper with minimal impact on the designer? Thanks in advance for any suggestions.
// Exposing functionality from under a Wrapper, courtesy Heath Stewart
private const int TVS_NOSCROLL = 0x8000;
protected override CreateParams CreateParams
{
get
{
CreateParams ret = base.CreateParams;
ret.Style |= TVS_NOSCROLL;
return ret;
}
}
|
|
|
|
|
You could put the create params in an enum and create a new control from the treeview
TreeViewEx or something and expose the parameters as a property
You can then set the property to noscroll for the implementation you want, instead of hard coding the create params. This also gives you a treeview which you can add extra properties later when you need them.
James
James Simpson
Web Developer
imebgo@hotmail.com
P S - This is what part of the alphabet would look like if Q and R were eliminated Mitch Hedberg
|
|
|
|
|
yeah, that's the solution i was trying to avoid, the TreeViewNoHScroll control. anyway maybe like you suggest it's the best way, and does have the plus of being the place to put in any other mods to TreeView.
Any way to deal with the downsides i perceive:
-- another file in the project
-- registering the control with the toolbox (which sometimes forgets which of my controls are registered anyway)
-- is it possible that TreeView will ever be changed and break my code.
Thanks in advance!
".. and Toto too."
(reassurance by Glenda, the good witch of the North)
|
|
|
|
|
I'm working on my own XmlSerializer/deserializer class, and while developing the deserializer, I've noticed that Type.GetType("System.Drawing.Color") is returning null instead of a Type object. What's the reason for that? I don't see an explanation in the documentation, and I can do Type.GetType("System.Double") fine, so it's not an issue with ValueType objects... Perhaps it's an issue with structs for some other reason?
Thanks,
Arun
|
|
|
|
|
It expects the FULLY QUALIFIED NAME (iow assembly name, ver , etc, public key).
Rather use typeof(Color) or recursive thru the loaded assemblies.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Ah, okay, that must be it, thanks! System.Drawing.Color is not in my assembly or mscorlib.dll, it's in System.Drawing.dll.
I guess I'll iterate over loaded assemblies and see if they have the type I'm looking for.
|
|
|
|
|
You don't need to iterate... you know it belongs in System.Drawing.
Assembly a = Assembly.LoadWithPartialName("System.Drawing");
Type t = a.GetType("System.Drawing.Color");
...will do the job
|
|
|
|
|
Hmm, yes, but can I generalize that for other times and other assemblies? I'd hope also that it wouldn't actually reload the already-loaded assembly.
Thanks,
Arun
|
|
|
|
|
Arun Bhalla wrote:
I'd hope also that it wouldn't actually reload the already-loaded assembly.
It wont reload it (unless u have changed it of course).
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
Good to know that it's implemented smartly!
I'm still not sure I can generalize across types. Perhaps I can for the types I use presently, but maybe not in the future. That is, I'd rather not store the assembly name (partial or full) in my file, especially since LoadWithPartialName isn't preferable for long-term, according to documentation.
Arun
|
|
|
|
|
i started learning c# because i had a nice idea about to write a program for windows and its my first time i program for windows so i wanted to learn the latest technology , which seems c#+forms, i started learning and it was really good nice language and seems fun and simple.
i learned the basics and all was well , but then i decided to learn the stuff i needed for my idea , and i needed midi api, i looked everywhere and i couldnt find it !!.
apparently there is no midi support in c# (i dont mean play a .midi file, i need full control over the notes and everything).i checked managed directx and nothing there too !! , i got really upset.
the only thing left to do that i can think of is code the midi with c++/unmanaged directx into a dll and use it with my c#/forms UI.
since i have no experience with dll's, and mixing managed/unmanaged code what i need is tutorials and maybe some examples how to do it.and if mixing unmanaged directx is a problem?
|
|
|
|
|
You know, I'm almost thinking about writing a .NET/DirectX tutorial...
Anyways, until I work up the motivation to do so, have you tried using the Managed DirectX libraries? Go to the DirectX portion of MSDN and look for the Managed DirectX 9 SDK.
Not a in-depth music programmer myself (I do graphics), but that may help you out.
Jeremy Kimball
|
|
|
|
|
hi
This is great news, i really love to read a tutorial, cant wait.
well, before i learned c# i wrote a nice music program for my engineering project, using very complex algorithm to synthesize many notes from a single note. since i needed to write a program that uses this algorithm, i wrote a windows application with c++ & directx , i used directsound to play the notes , and to learn more directx i also wrote my own gui using direct3d.
what im trying to say is that i know directx a little, and i learned c#+forms because i wanted to start learning standart gui's with the latest technology, to develop a newer simpler version of my university project , dropping the directx gui to write simple window's gui, and dropping the complex algorithm for simple midi, this will allow me to extend the programm really simple and fast.
the first this i checked is managed directx, and to my surprize microsoft did something strange, the added directDraw and removed directmusic. so no midi in managed directx
this is too long but i hope to give you motivation for the tutorial.
Gonen
|
|
|
|
|
hi
i dont know if you looked at my replay on the forum , so here's the link
http://www.codeproject.com/script/comments/forums.asp?msg=647484&forumid=1649&XtraIDs=1649&searchkw=unmanaged&sd=8%2F1%2F2003&ed=10%2F30%2F2003#xx647484xx
i really hope you will write a .net/directX tutorial , no need for fancy stuff , just teach how to combine the two together will be great
Gonen
|
|
|
|
|
I've been noticing a strange problem related to threading and debugging them in VS .Net 2003 recently and am not sure if this is a) a bug in VS b) something odd I just don't understand and/or c) the cause of a related problem I seem to be having.
The issue is this, I'm using ThreadPool.QueueUserWorkItem to create various asynchrous actions. The generally works fine. On occassion (its difficult to exactly replicate) my process suddenly starts using 100% of my machine's processor without stopping. When I pause the execution in VS and look at the threads there are two listings for some threads (e.g. thread with ID 2480 is listed twice) but they are in the same execution position and seemingly one in the same. This is quite odd to me. I've noticed it happening for some time both using ThreadPool and when I create my own threads. There is no rhyme or reason why nor logic why some are double entered and some are not from a code standpoint. I tried to debug the creation some time back but could not get it to stop from listing twice.
So my question is as above, is this a VS bug, some strange thing happening in my code, or some other artifact? I can't confirm but I'm suspicious this is why I'm getting runaway threads who, when I try and debug them, the debugging info is all corrupt and I can barely even step through them. Any and all suggestions are welcome. I'm a bit of a newbie with VS.
Thanks in advance,
Andy
|
|
|
|