|
Hey Guffa!
Hmmm, I was thinking about that from the beginning, but how to do so?
S.
|
|
|
|
|
sascho wrote:
Encoding encode = System.Text.Encoding.GetEncoding("windows-1252"); //("utf-8");
// Pipe stream to higher level stream reader with req. encoding format.
StreamReader readStream = new StreamReader (receiveStream, encode);
if (debug==true) Response.Write("\r\nResponse stream received
");
Instead of using a StreamReader, have you tried using a BinaryReader[^]? You don't have to specify an Encoding with it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You could also try the following (very simple) code:
System.Net.WebClient wc = new System.Net.WebClient();
wc.DownloadFile(URIString,FileNameString);
maybe this is not that complicated for such a trivial task.
best regards
jkersch
|
|
|
|
|
Is it possibe to create a transparent avalon application? And would alpha-blending, blur and other effect's work normally? It's hard to believe that this could be done in XP because programs aren't textures unlike in Vista. But on the other hand, didn't they make those cool blur effects in Vista's IE7 with avalon? (and as you all know, WinFX is also available for XP) If not, then how?
|
|
|
|
|
You should try VG.net[^], their newest version can show graphics in an alpha-blended window!
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
Not only that, but it's incredibly easy.
For a really basic translucent form, just create a Picture in the designer (instead of the default Form in the application), and then put this code in your picture class:
[STAThread]
static void Main()
{
TranslucentForm form = new MainPicture().DisplayInTranslucentForm();
form.Text = "VG.net Calculator";
Application.Run(form);
}
...and set the picture as the startup class. Your picture will then display on its own with true transparency and translucent (alpha-blended) effects. VG.net also has some new additions to make it extremely simple to allow custom window moving, resizing, minimizing, closing, etc for your translucent UI, with no custom code needed. You can see more here[^].
|
|
|
|
|
|
Marc, that is C# 2.0. And no, there isn't a better way.
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
|
Meh. I don't think that it's a good idea for them to support unions in C#. Here's one guy's take on it from Mono: http://lists.ximian.com/pipermail/mono-devel-list/2005-April/011577.html. If you really need a union, you should probably just wrap a C++/CLI union with some managed code.
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
The MouseMove event doesn't fire if the mouse is over a control contained by a form. Is there anyway other than calling MouseMove for every one of my controls to track the current mouse position anywhere on a form?
|
|
|
|
|
Looking farther, since groupboxes don't have the MouseMove event, even if I called my handler from subcontrols I'd still have gaps in my coverage. Any solultion?
|
|
|
|
|
If you want to know where it is, you can use Cursor.Position . It is in screen coordinates though, so have to substract the location of the form from it.
If you want to be notified of every move of the mouse on your form, you can implement <a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsimessagefilterclasstopic.asp" rel="nofollow">IMessageFilter</a>[<a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsimessagefilterclasstopic.asp" target = "_blank" rel="nofollow">^</a>] . Then, in PreFilterMessage you can handle the <a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/mouseinput/mouseinputreference/mouseinputmessages/wm_mousemove.asp" rel="nofollow">WM_MOUSEMOVE</a>[<a href = "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/mouseinput/mouseinputreference/mouseinputmessages/wm_mousemove.asp" target = "_blank" rel="nofollow">^</a>] (= 512) message.
Hope this helps!
Pompiedompiedom...
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick
|
|
|
|
|
I have an MdiParent form. This form has an MdiChild form. On MdiChild I have a button that opens another New form. But this form opens outside the MdiParent. How do I make the New form an MdiChild.
Please Help
|
|
|
|
|
The same way you made your Child form a child. Create the form object, set it's MdiParent property to the same parent that this child is using, ...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yo, thanks man, i tried fiddling with it and it worked.
Enjoy.
|
|
|
|
|
there is no events called, nothing.
I know there are qiute a few work arounds, like
calling api or not showing controlbox at all.
what I would like to know is why after closing form from
controlbox X, call to MyForm.Show does not do anything,
not even error.
and also is there a way to trap that click on controlbox
but stay within managed code.
TIA
|
|
|
|
|
Are you refering to the X in the upper right of the titlebar? If so the Closing and Closed events do fire on either side of the forms death. Using Closing you can abort the process by e.Cancel to true.
|
|
|
|
|
Hi,
I should like to write trace lines (using Trace.WriteLine or even Console.WriteLine) to a console window, but this time from a Class module.
The class module does not create a Console (aka command line)window, so Console.WriteLine does not work. Neither could I find an example of specifying a (or creating a) console window for this kind of output.
Anybody Any Idea how to do this?
Tx Aad
Aad Slingerland
Zevenaar
The Netherlands
|
|
|
|
|
Applications for either the console or windows subsystem won't display output for Trace.WriteLine unless you add the following lines of code before calling your first Trace.WriteLine (or Debug.WriteLine ):
Trace.Listeners.Add(new TextWriterTraceListener(Console.Out)); To display a console window for a Windows Forms applcation compiled for the window subsystem (because a Windows Forms application can be compiled for the console subsystem and work, plus write console data; ildasm.exe is compiled this way) you'd have to P/Invoke CreateConsoleScreenBuffer and write a TextWriter around that for use with the TextWriterTraceListener , or just write your own TraceListener derivative to do that.
The easiest is just compile your Windows Forms application using /t:exe instead of /t:winexe so that you already have a console attached to the process.
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 Heath,
I give this a try first thing in the morning. Be back...
Tx Aad
Aad Slingerland
Zevenaar
The Netherlands
|
|
|
|
|
Sound like you might be doing what I was doing. I kept writing Console harness apps to get the output to track what's going on while developing until I found out about System.Diagnostics.Debug.WriteLine() . If you're using .Net Studio, it will display the information in the Output window. I use it in both windows forms or special classes that have no GUI interface. Sure beat the heck out of the test harnesses.
|
|
|
|
|
Working on the subject I found a even simpler way to create a console window from within a class module. It requires two p/invoke functions from kernel32 and than Console.WriteLine () will do! It goes like this...
bool b = AllocConsole ();
Console.WriteLine ("This...");
Console.WriteLine ("...That");
bool b = FreeConsole ();
Aad
Aad Slingerland
Zevenaar
The Netherlands
|
|
|
|
|
Please tell me there's an easier way. Here are a few examples of my recent pain:
It took me a day and a half of searching the Web, MSDN, and 6 books about C# before I found out there was an OpenFilaDialog class for asking the user which file they wanted my app to open.
It took me mere seconds to code a KeyDown event on my RichTextBox, and to figure out that I needed to use KeyEventArgs.Control to see if the control key was pressed, but it took several hours of searching to figure out I needed to compare Keys.L to KeyEventArgs.KeyCode to find out if <ctrl>L was pressed.
It took me hours of searching to find out that "Cursor.Current=Cursors.WaitCursor;" would change the mousepointer to the hourglass while my program retrieved from the database.
I am not stupid, I have been programming for over 25 years, in RPG, COBOL, TOTAL, ADS/O, PowerBuilder, and probably others along the way.
My whole department is going to come to me when they have the question: "In .NET, how do I...?", and I don't want to tell them I'll get back to them in a week.
I bought "C# for Experienced Programmers" by Deitel because it was the only book I could find that told me about the OpenFileDialog class. It did not help me with the other two situations I had.
I just have to beleive there is a better way...
|
|
|
|
|
My recommendation is to skim through the table of contents for the Class Library[^] to see what classes there are. I've seen many times where people are looking for something or end up writing something over when there was a class already for it. You wouldn't necessarily have to read about all the classes (at least the ones in which you're interested or the name is not self-explanitory enough) but just see what there is.
Also being familiar with the major abstract classes like System.Windows.Forms.Control is important. They define much of the functionality of their derivatives and understanding how they work is important. I also recommend that when you get more familiar with classes you see how they work under the covers using ildasm.exe from the .NET Framework SDK or a decompilers like .NET Reflector[^].
It's really just a case of getting to know the classes for such a large class library. Guessing also helps. If you're looking for an open file dialog, type "OpenFileDialog" (case not important) in the index of your Visual Studio Combined Help collection in the Visual Studio program group in yoru start menu. The local index is much easier to search than MSDN since there it's a keyword search, while and index like the combined collection (or the quarterly MSDN Library if you subscribe) is designed to help you be more efficient. When you get used to the class naming conventions of the .NET base class library (BCL) it gets easier to guess what a useful class name is. Type it in the index and read about it.
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]
|
|
|
|