|
1. Make sure your TextBox 's Multiline property is true .
2. TextBox es don't like "\n". Use String.Replace("\n", "\r\n") on the data to give it the CRLF newlines it likes.
--
I've killed again, haven't I?
|
|
|
|
|
You should replace the \n with Environment.NewLine rather than hard coding \r\n
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks a lot, Everyone! Now it worked.
-- modified at 20:06 Tuesday 16th May, 2006
|
|
|
|
|
If you insert Environment.NewLine and Multiline is true, the text will show as multiline. If not, post your code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Now it worked, sorry it's my mistake before. Thanks a lot!!!
|
|
|
|
|
Does anyone know how to stop a service form being killed by the Task Manager or any other method other than the services own stop function.
If this is at all possible?
Cheers
|
|
|
|
|
I don't think it is, as it wouldn't be a particularly desiarable behaviour (unless you were writing a virus or something).
The best way to stop users from meddling with task manager is through user accounts and permissions - an often neglected, but very important, part of system administration.
|
|
|
|
|
Yes, on the Stop function loop for 45 seconds, the service stoper will time out. Now this is kind of stupid to do.
My eMail control
My Blog
|
|
|
|
|
The problem I have this that we have written a service/application that monitors usage and controls access using a booking system to around 3000 workstations, but some users have found that by killing the service this then stops the service from logging them out when the booked time has elapsed
I supposed then answer is testing the current user who is tiring to exit the service and testing the system exit status.
Looping on the on stop would work if you could tell if the workstation is in a state of shutting down forced or not.
|
|
|
|
|
This is more a training problem than a computer problem.
Solution:
Step 1: Identify the user.
Step 2: Fire the user.
Repeat as necessary.
|
|
|
|
|
|
Is there any way to find the compiler's CLR version to use in an #if clause?
Something like:
#if CLR == 2.0
//do this
#endif
Thanks in advance,
Rei
|
|
|
|
|
Every .Netframework leaves a key in:
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy"
For example if the machine has 2.0 Framework installed then there will be:
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\v2.0" key in the registry
try this code:
if (Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\.NETFramework\\policy\\v2.0") != null)
{
//Do something
}
but that will work fine with the if statement, not with the preprocessor directive #if.
|
|
|
|
|
You can't access any C# constructs from the precompiler directives though... only the precompiler variables and a small handful of comparative expressions.
|
|
|
|
|
Sorry for the mistake. I fixed my message though. I will look for it, if I find something I'll let you know.
But, can you give me a hint why you want it in a preprocessor directive rather than ordinary if statement?
|
|
|
|
|
I'm trying to use System.Drawing.BufferedGraphics, which is only available on .NET 2.0. I could use System.Drawing.Bitmap instead, but it's slightly less performant.
Also, some of the form mouse events are slightly different between the two versions.
I want to avoid having two copies of the code if I can, so I want to use the preprocessor to distinguish between the two.
There's one variable, VC_V7 that's used in an example in the C# documentation on MSDN, but that's only for Visual Studio (I think... I'm not sure why it'd be VC_V7).
Thanks for helping
|
|
|
|
|
http://msdn2.microsoft.com/en-us/library/0feaad6z.aspx[^]
The C# compiler itself defines no symbols or macros that you can use in your source code; all symbol definitions must be user-defined.
That's why there's no documentation
Guess I'll have to find some ways to work around it.
Thanks though.
|
|
|
|
|
Hi. I have a winform (with fade-in and fade-out effect) and I run it on VS 2003 and works great. But when I use VS 2005, the winform appears like with flicks, it's like it had a rendering problem. The example works great with VS 2003, but I have to run in in VS 2005.
Any ideas??
Thanks a lot !!!
|
|
|
|
|
Try this in the form's constructor:
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
If that doesn't work, try playing around with the other ControlStyles things.
That might fix it.
|
|
|
|
|
I still have the problem.
Any other ideas ??
Thanks a lot !!!!
|
|
|
|
|
Hmm... try turning off the Application.EnableStyles thing in the Main() method, if it's there.
|
|
|
|
|
Reinux, I can't see the option you're reffering , only one: Application.EnableVisualStyles(); but it isn't take any parameters.
Thanks a lot !!!
|
|
|
|
|
Try taking the whole line out.
It's sorta optional.
|
|
|
|
|
|
I'm out of ideas
|
|
|
|