|
That's not enough. I had to this:
this.SetStyle(ControlStyles.AllPaintingInWmPaint|ControlStyles.DoubleBuffer|ControlStyles.UserPaint,true);
So it goes through OnPaint. But now I have a tricky bug perhaps you can help me: I put into the treeview one root node and a child node; painted is only the root-item (altough ExpandAll()). But when I hover over the invisible ChildItem the ChildItem is painted. Strange.
Can you help me?
|
|
|
|
|
I'm looking for a C# class/function/whatever to parse Internet dates (as used in SMTP, NNTP, ...) to System.DateTime. Someone must have already done this, but I can't find anything (found lots of Internet dating services though )
Anyone know any good pointers?
|
|
|
|
|
Bjornar Henden wrote:
Anyone know any good pointers?
Pointers are entirely unsafe and never good.
On a more serious note, have you tried the static
DateTime.Parse()[^] method?
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
I've tried, but haven't had any luck so far. Maybe I haven't tried hard enough, but to me it seems DateTime.Parse parses date strings from a given culture.
|
|
|
|
|
Try DateTime.ParseExact
<br />
String date = "Sun, 06 Nov 1994 08:49:37 GMT";<br />
DateTimeFormatInfo di = DateTimeFormatInfo.InvariantInfo;<br />
DateTime dt = DateTime.ParseExact(date, di.RFC1123Pattern, di);<br />
Console.WriteLine(dt.ToString());<br />
|
|
|
|
|
Thanks for the tip. Exactly what I was looking for. Unfortunately it doesn't seem to handle numeric timezones ("Sat, 01 Mar 2003 15:20:29 +0100"), which I need.
|
|
|
|
|
|
Does anyone know how to make the windows combobox flat like you can with buttons, edits etc.
If it is not posible to make it flat does anyone know of a flat combobox component that i could use?
Thanx
Tim
|
|
|
|
|
Tim, look at the C# Controls > Combo and ListBoxes section here on CP.
|
|
|
|
|
Hi!
When I do the walktrhough "Creating a Distributed Application", in section 'To create the Windows application' item 4 where I try to 'add web reference' I get the following message, Why?
The document at the url http://localhost/DeDUWebService/DeDUWebService.vsdisco was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'WSDL Document' is 'There is an error in XML document (2, 2).'.
- <dynamicdiscovery xmlns="urn:schemas-dynamicdiscovery:disco.2000-03-17"> was not expected.
- Report from 'DISCO Document' is 'Discovery document at the URL http://localhost/DeDUWebService/DeDUWebService.vsdisco could not be found.'.
- The document format is not recognized.
- Report from 'XML Schema' is 'Expected Schema root. Make sure that the root element is <schema> and the namespace is 'http://www.w3.org/2001/XMLSchema' for an XSD schema or 'urn:schemas-microsoft-com:xml-data' for an XDR schema. An error occurred at (2, 2).'.
MSc Bertil Morefält
|
|
|
|
|
Hi,
I'm building a query that can have some "prohibited" characters like... " ' % ...", is there any function that replace that characters for something "not problematic" or compatible ?
Thanks in advance, greetings
Braulio
|
|
|
|
|
Braulio Díez wrote:
is there any function that replace that characters for something "not problematic" or compatible ?
The String data type has a Replace function, check it out. String.Replace[^]
-Nick
|
|
|
|
|
Hi,
Can I use web services ( as a client), with old versions of visual basic and Visual C++ ( 6.0), with the .net framerwork installed ?
Thanks in advance
Braulio
|
|
|
|
|
You can use WebServices from legacy apps...you just need to look on MSDN for the SOAP toolkit.
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
Hi,
Just download the Microsoft SOAP Tookit 3.0 .. Its on the Microsoft website. There are also Code Samples you can download.
If you have trouble I can post some code for you ..
|
|
|
|
|
Hi,
Can I use web services ( as a client), with old versions of visual basic and Visual C++ ( 6.0), with the .net framerwork installed ?
Thanks in advance
|
|
|
|
|
Two questions
1. I'm trying to use SMTP mail to send email from an application. Code works fine but the messages are left in the C:\Inetpub\mailroot\Queue folder. I have added localhost to the SMTP server settings (connection and relay).
MailMessage msg = new MailMessage();
msg.To = "my email";
msg.From = "my email";
msg.Subject = "test";
try
{
SmtpMail.Send(msg);
}
...
2. Previously I have used Mapi (in C++) to send mail using the local email settings. Does anyone know of a way to do this in C#. It seems better to use the local email program (outlook/outlook express) than having to configure an SMTP server for each user.
I’m probably missing something obvious, so any ideas on this would be great.
|
|
|
|
|
Well, MAPI is an API for the local client e-mail whereas the System.Web.Mail namespace deals only with SMTP servers. There's a reason it's in the System.Web namespace: they assume you're going to have an SMTP server of your own that you can point to. Are you trying to send mail from a Windows Forms app? (It looks as if you are) In that case, why not just use MAPI from C# and write up a CP article about it? Sure, it would involve P/Invoke, but it would get you the desired result.
any idiot
can write haiku you just stop
at seventeenth syl
-ThinkGeek Fortunes
|
|
|
|
|
I found a mapi example. Code Project/C# Programming - Simple MAPI.NET by NETMaster.
I will try to get the SMTP working, but i assume that is a bit of topic here.
thanx
|
|
|
|
|
just thinking out loud, what's equivalent of dll and COM in .net?
remoting replaces DCOM... what about COM? or just dll?
i'm just starting off in C#.
norm
|
|
|
|
|
the equivalent is class library , windows control library
|
|
|
|
|
I have what is a very annoying and subtle little glitch that I cannot get rid of. I'll try to be brief and to the point.
I have a form, on it are a handful of Label controls that I have subclassed, but I haven't changed the way they draw or render at all, just added some private properties to them specific my app.
When you click on the label, a ContextMenu is shown, and the label's image property recieves a different image to show it in a downstate.
If you chose not to select a menu item and click somewhere within the form, the context menu dissapears, naturally, and the label's image state returns to normal.
However, if you click *outside* the form while the context menu is displayed, say on another application behind the form, which has the effect of the form losing its focus and falling behind, and then if you bring the form back to focus, the label's image can be seen for a half second to still be in its down state before changing back to the normal state.
I have tried to put the code that returns the labels image state to normal *everywhere* in the lifecycle of the form's visibility that I can possibly think of. But no matter what, for a half of a second you can still see it in its down state when the form returns.
I am pulling my hair out. It sounds trivial, but it looks very bad, and I cannot allow it to behave this way when released. Is there something I'm missing? Maybe something to do with validation of controls?
Anything?
Thanks for any ideas people might have and hearing my little tale of woe.
Matttingly
|
|
|
|
|
So adding a Form.Deactivate handler doesn't do the trick? Don't bother with validating stuff, it's just another thing in the focus event sequence. Did you try calling Update() to force an immediate repaint? Otherwise, invalidation just puts a WM_PAINT message in the message queue, which could already be loaded with other pending messages.
|
|
|
|
|
Yeah I tried it in Form.Deactivate and that didn't do anything. It does work, but the point is that it seems to actually get redrawn *after* the form is made visible again.
I should point out when the form is losing focus I make it Visble = False, or I think I might use .Hide().. But when it comes back I tried putting that in the Deactivate() handler and it redraw roughly a half second after the form is made visible again.
I will try Update(), that is one I hadn't thought of. Also I should point out I am using the Opacity property as well as transparency on some parts of the form. I don't see why this would matter, but with that stuff you never know..
Thanks, I'll post back my luck with Update(). I appreciate the response.
Mattingly
|
|
|
|
|
Thanks so much! Update did the trick.. Perfectly
|
|
|
|