|
Hi,All!
I created users control inherited from TextBox.
And I added new validator
this.Validating += new System.ComponentModel.CancelEventHandler(maskedValidating);
When I'm closing form where that control used,
the maskedValidating raising, and form don't closed while maskedValidating is false.
Question is:
if I'm closing a form so I needn't to invoke that validating
How I can teach that control to undestand that situation.
Thank.
shab
|
|
|
|
|
Is there any way to change the color of header in a ListView. Any C# Guru can help me in this matter I will be really thankful.
|
|
|
|
|
Hi!
I'm having a problem with the HttpWebRequest - when I recieve the stream it looses the ÅÄÖ (and some other...).
The Code:
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create ("http://www.dvdforum.nu");
HttpWebResponse response = (HttpWebResponse)request.GetResponse ();
StreamReader reader = new StreamReader (response.GetResponseStream ());
StreamWriter writer = new StreamWriter ("google.html");
string buffer = "";
while ((buffer = reader.ReadLine ()) != null)
{
writer.WriteLine (buffer);
}
reader.Close ();
writer.Close ();
System.Diagnostics.Process.Start ("google.html");
Any idea how to fix this?
Andreas Philipson
|
|
|
|
|
You need to provide an System.Text.Encoder to StreamReader and StreamWriter to handle the conversion from bytes to chars (it's not the same thing in .NET).
Which one will be some guesswork, but they are only 4 or 5.
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
|
|
|
|
|
That was my first thought too, but none will give the right result
Andreas Philipson
|
|
|
|
|
Try:
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("iso-8859-1"));
|
|
|
|
|
When I double click a ListViewItem it's automaticaly checked. How can I disable this ?
By default if you single-click any item it becomes selected, but not checked. If you double-click a single item, it becomes selected and checked, and all previously checked items remain checked.
-- Ingram
|
|
|
|
|
I learned from my own question and had to to override the WinProc method to handle the double click message that is sent to the list control.
This prevents the checkbox from being checked from double-clicks, which is more natural in my opinion, just as it is in TreeView.
This might be a good beginner article, since I had no idea what WinProc was until today.
using System;
using System.Windows.Forms;
using System.Diagnostics;
using System.ComponentModel;
namespace MyTestListView
{
[ToolboxItem(false)]
public class MyListView : System.Windows.Forms.ListView
{
private const int WM_LBUTTONDBLCLK = 0x0203;
#region Constructors
public MyListView()
{
}
#endregion
#region Overrides
protected override void WndProc(ref Message message)
{
switch (message.Msg)
{
case (int)Msg.WM_LBUTTONDBLCLK:
{
Debug.WriteLine("Double-Clicked");
} break;
default:
{
base.WndProc(ref message);
} break;
}
#endregion
}
}
}
-- Ingram
|
|
|
|
|
When I compile the .cs file, I found following mistake: The type or namespace name 'DocumentNavigator' could not be found (are you missing a using
directive or an assembly reference?)
Is there anyone know how to solve this problem??
|
|
|
|
|
Actually, the answer to your question is right in the error message. The compiler doesn't know where to find "DocumentNavigator". In C++ you would tell it how by using a #include. In C# you do this by typing in the full namespace for DocumentNavigator, or by a "using" statement that references the namespace where you find DocumentNavigator. (Check MSDN help to find out where it is if you don't already know.)
John
|
|
|
|
|
Is it possible to use COM+ object pooling with .Net remoting. I mean can i have a remote object that is pooled by COM+
Help me James .T
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Sijin wrote:
Help me James .T
I don't know enough about COM+ to help you there. You might want to check the DOTNET and DOTNET-CLR archives to see if someone else has asked the same question.
DevelopMentor's mailing list homepage[^]
James
- out of order -
|
|
|
|
|
James i think i am getting it a bit now, after two continous days of R&D, the problem is that even i didn't know enough about COM+ and so was asking the wrong questions?. But i found a great article on www.dotnetnut.com which discusses COM+ and .Net.
You see the thing is that if i mark an object as being managed by COM+ then when it is instaniated them the CLR automatically registers it in the COM+ catalog and then provides COM+ services like pooling and JIT and transaction support etc. for the object, which is great for apps which have to be scalable.
Btw, what took you so long to reply, busy with another great article i hope, looking forward to it.
May the Source be with you
Sonork ID 100.9997 sijinjoseph
|
|
|
|
|
Sijin wrote:
Btw, what took you so long to reply, busy with another great article i hope
Sadly, no. I've been busy with a large project so I haven't been hitting CP as much as I used to.
James
- out of order -
|
|
|
|
|
Hi
How do I make a modal dialog box that returns OK or Cancel?
tx
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
I figured it out. For those interested, you set the "CancelButton" form property to one of your buttons, and, for the "OK" button, you set the button's property "DialogResult" to "OK".
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
You can also do it manually (via code) by setting the DialogResult property to DialogResult.OK and DialogResult.Cancel .
This is especially useful when doing form validation in your OK button click event handler. If the form is invalid, just set DialogResul to DialogResult.None .
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
I want to develop an application in C#, a plain simple window with "Hwllo World" string displayed in the centre. Thats it!!
Then i want to distribute this product. Please tell me what "minimal" things i need to include with the setup program of this very simple application???
Also tell me the combined minimal size of the resultant things that i need no distribute, so that this application "successfully" work onsystem having no .NET installed proviously.
|
|
|
|
|
You need the .NET redistributable installed (25mb) to my knowledge it is not possible to run it otherwise.
Why waste time learning when ignorance in instantaneous
-Hobbes
|
|
|
|
|
Last Thursday, we announced a few future C# language features at OOPSLA 2002. The features are:
* Generics
* Iterators
* Anonymous Delegates
* Partial Types
Note that these features are not in the version of VS that's current in Beta, VS "Everett".
For more information - and to sign up to receive email when we have specs ready - visit http://www.csharp.net
|
|
|
|
|
Eric Gunnerson (msft) wrote:
* Generics
* Iterators
I can't wait for these.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
If you really can't wait you could try Envision! (Eiffel .NET for Visual Studio .NET)
http://www.eiffel.com. There is a free non-commercial version.
Kevin
|
|
|
|
|
|
Thank goodness leppie...I didn't know either...
You will now find yourself in a wonderous, magical place, filled with talking gnomes, mythical squirrels, and, almost as an afterthought, your bookmarks
-Shog9 teaching Mel Feik how to bookmark
I don't know whether it's just the light but I swear the database server gives me dirty looks everytime I wander past.
-Chris Maunder
|
|
|
|
|
An iterator is a practical and innovative language construct based on similar features in research languages such as CLU, Sather, Icon, and more. Simply put, iterators make it easy for types to declare how the foreach statement will iterate over their elements.
I'm more confused than I was before. Innovative ? Are we talking about something different to what the STL calls an iterator here ?
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
|
|
|
|