|
You can override the WndProc function and intercept WM_PAINT. By overriding WndProc IMHO you should be able to do everything you could by Win32 subclassing.
Cheers
HTH
Martin
"Situation normal - all fu***d up"
Illuminatus!
|
|
|
|
|
Thats sort of what I was thinking also, I just wanted to hear someone else say it. I don't want to spend a lot of time right now going down that road only to run into more unexpected issues, but I might try it in the near future. Thanks.
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
I want to catch the "SCROLL" events on a ListView control,
in order to code something like a dynamic populating ListView.
Someone knows about that?
|
|
|
|
|
You can use WndProc to catch messages if needed:
i.e.
protected override void WndProc( ref Message m )
{
if( m.Msg == 0x0114
|| m.Msg == 0x0115 )
{
}
base.WndProc( ref m );
}
"Any clod can have the facts, but having opinions is an art."
Charles McCabe, San Francisco Chronicle
|
|
|
|
|
Thanks!!
It's nice.
|
|
|
|
|
When I create a .Net windows client that calls a .Net web service I can maintain session state on the web service as long I set the CookieContainer property to a new instance of a CookieContainer within the client side web service proxy.
Now, when the client of the web service is a .Net web site, I can't seem to maintain web service session state. I have made sure that the web service proxy and the CookieContainer have been persisted in a web site session variable, but every time the web site calls the web service, the web service sees a new session cookie and establishes a new session state.
Anyone having this same problem, or better yet solved it?
Thanks to anyone who responds.
|
|
|
|
|
...size. I'm just a beginner, but I'm trying to get the form to be maximised in the window. I now it's not to difficult, and I've even manage to do it some days ago, but I deleted the code and now I can't find out how I did it
Please help me...
Børge
|
|
|
|
|
Munti wrote:
but I'm trying to get the form to be maximised in the window
Use the Form.WindowState Property and set it to FormWindowState.Maximized
e.g. (from MSDN)
public void InitMyForm()
{
Label label1 = new Label();
label1.Location = new System.Drawing.Point(54, 128);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(220, 80);
label1.Text = "Start position information";
this.Controls.Add(label1);
WindowState = FormWindowState.Maximized;
label1.Text = "The form window is " + WindowState;
}
Paul Watson Bluegrass Cape Town, South Africa Ray Cassick wrote: Well I am not female, not gay and I am not Paul Watson
|
|
|
|
|
Excelent, worked perfectly
Thanks, Børge
|
|
|
|
|
None of my .NET apps, which run fine on XP, are running on W2K. I've loaded SP3, IE6, and DOTNETFX.EXE. I get "Application has generated an exception which could not be handled." BTW, these apps also run fine on my W2K machine on which I've already installed the dev environment.
No networking issues, etc.
Any ideas? I don't want to load the entire dev environment because I'm afraid then the problem will go away without my knowing why!
Marc
Help! I'm an AI running around in someone's f*cked up universe simulator.
|
|
|
|
|
If you are using Data Access then MDAC 2.7 also needs to be installed.
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Is it possible to serialize an Exception derived class? When I try to add an exception to a System.Messaging.Message object (which internally serializes the object to XML) I receive the following error:
System.InvalidOperationException: There was an error reflecting 'Send.DALException'. ---> System.InvalidOperationException: The property 'Source' on type 'System.Exception' cannot be serialized because it is decorated with declarative security permission attributes. Consider using imperative asserts or demands in the property accessors.
What does this mean? Can I get around it?
|
|
|
|
|
I'm giving a talk on GDI+ (which I know) and am looking for a comparison with DirectX.
Does anyone have any links or maybe some points for me to ponder on?
Cheers,
Simon
"VB.NET ... the STD of choice", me, internal company memo
|
|
|
|
|
It's a bit like comparing a car with a plane. Both are modes of transport, but used for different things. DX is faster than GDI+, and it's also harder to use. It's notoriously hard to set up, especially in 3D. DX also includes modules for playing sound, movies, and networking.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
What tool or product do you recommand to create a program that installs a .NET Windows Form component?
Does Microsoft provides one such tool with the .NET SDK?
|
|
|
|
|
There's the Windows Installer projects that are seemlessly integrated with VS.NET. You can even assign your build outputs, sources, content, etc. to directories and what-not. If you really don't mind learning the internals of the MSI database, you can get free tools in the Platform SDK, but you have to do almost everything yourself. Otherwise, you could go with commercial solutions.
Another options lies in the System.Configuration.Install namespace, where you use and create installer classes that can do about anything, from installing Windows Services to VS.NET toolbox items to custom CodeGroups. To use these, you use installutil.exe [options] MyAssembly.dll . InstallUtil.exe is a utility in the .NET SDK.
There are other free solutions out there, but none with support for .NET assemblies that I've seen. I recommend either the Windows Installer projects in VS.NET or writing custom installers like I also mentioned.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Thanks very much for these informations.
Just another question: where can I find the Windows Installer projects in VS.NET?
|
|
|
|
|
If you need a sample Windows Installer project, you can try Desktop Bob[^]
lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
|
|
|
|
|
Add a new project to your solution (with your existing project, making build outputs available to your setup project) from the Deployment category. There should be several options available to you. Use the wizard if you're not sure about what to do. It does quite a bit for you.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
Thanks. The Deployment wizard seems to be a very good starting point. It is a good surprise for me. Until now, I had not noticed its existence.
|
|
|
|
|
Converting an Icon to an Image is easy: Image img = ico.ToBitmap() - except when you need alpha blending. After digging through the IL for Icon.ToBitmap(), the concept is simple and helped me find some .NET docs that discussed off-screen rending with alpha channels. The following code should work:
Image img = new Bitmap(16, 16, PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(img);
g.CompositingMode = CompositingMode.SourceCopy;
g.DrawIcon(Icon.FromHandle(hIcon), 0, 0);
g.Dispose();
If I display img in a PictureBox or draw it in a form's graphics object, the alpha channel is all black. If, instead, I draw the icon directly on the form, the alpha channel is blended accordingly.
I've also tried filling the graphics object for the Bitmap img with SystemColors.Control (default for Form, etc.) and then drawing the icon after setting the compositing mode, but that doesn't work either.
Has anyone successfully done this? I'm trying to make a wrapper component for SHGetFileInfo which works pretty well except for the whole alpha blending problem described above. TIA
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
After some digging, the problem is not so a Graphics problem as it is a common controls problem. In order to get the icons to appear with the alpha channel, you have to use a .manifest file for the application as I described in one of my tutorials (just didn't realized that applied to alpha-blended icons, although I now understand why - the list control needs to be the CC6 list control).
Now my problem is only having one particular assembly redirect to CC6 in the Windows XP SBS cache, but despite what the MSDN docs say regarding SBS, this doesn't seem to work for DLLs without having a coresponding .manifest for the EXE (which makes a lot of things appear wrong). .NET assemblies must not use an Activation Context (in the Win32 part of the loading process) like SBS assemblies do. Any ideas of how to make just a DLL use the manifest file or resource (RT_MANIFEST) without forcing the application to?
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
I'm using OleDbDataApapter, et al to access an MS Access database in a C# application.
I have created form with various data bound controls for form-based record navigation.
However, when I try to update the database from the current changes in the data set I get an OleDbException indicating that the UPDATE Statement is invalid. Is there a way to get at the actual statement that is sent to the database?
I know you can get the UpdateCommand text, but this has placeholders for the parameters. If I can see the actual SQL command, then I can fix the problem, it's just a matter of getting hold of that SQL.
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
I'm seeing a lot of tutorials etc for .NET only in C#..
Would it be wise to switch to C# from VC++? In theory anything
in C# can be made in VC++ right?
|
|
|
|
|
In theory
Still, you have to know what you're trying to accomplish. For most purposes, C# is the language of choice for .NET. It should be fairly easy to learn the syntactic and language idioms of C# if you come from the C++ world (as I have.) The question is what usefulness/features do you get if you choose a particular language?
C#, IMHO, is a clean language. C++-esque syntax, with lessons learnt from Java and others, rolled into a beautiful construct. C#, obviously doesn't give you as fine-grained control as C++ using the Platform SDK, but there are plenty of Managed Classes that get you there without having to do a lot of the SDK work (for example, performance counters, network, or crypto.)
C++ is still in the hearts of many a code guru. Sometimes you don't need to use managed code, but there are things that are more difficult in C++ than in C#.
So is it wise? Learning is always wise.
"Good programming is language neutral, and is often more difficult to learn than a new language - after all, it's just syntax."
|
|
|
|
|