|
You may have to "\r\n" because the standard DOS newline sequence is two characters '\r' followed by '\n' as opposed to the one character version used by UNIX and MACINTOSH.
|
|
|
|
|
Try with Environment.NewLine
|
|
|
|
|
Hey, you gurus are fantastic.
Both "\r\n" and Environment.NewLine work.
Appreciate it so much
Khang Nguyen
|
|
|
|
|
Is there no way to pass an object by constant reference as you can in C++.
It doesn't seem to be possible in c#.
There must be some way of passing an object into a function and guaranteeing that the function does no change the object. This is a pretty basic and essential feature for writing robust code.
|
|
|
|
|
here's an example of 3 different constants in C#
VB:
<font color="blue">Public</font> <font color="blue">Const</font> int PBM_SETBKCOLOR = 0x2001;
<font color="blue">Public</font> <font color="blue">Const</font> int PBM_SETBARCOLOR = 0x409;
<font color="blue">Public</font> <font color="blue">Const</font> int WM_CLOSE = 0x10;
hope that helps.
My Signature
<font color="blue">Private void</font> ExpectingTwins(<font color="blue">string</font> twins)
{
<font color="blue">switch</font>(twins)
{
<font color="blue">Case</font> ("twins on the way"):
MessageBox.Show("for mr and mrs dynamic","twins on the way");
<font color="blue">break</font>;
}
}
|
|
|
|
|
I think SteveUK is talking about something like this in c++:
void foo( const string& text );
According to Programming C# by Jesse Liberty you can pass by reference but I was not able to find anything about passing by const reference:
void foo( ref string text )
{
...
}
The only ways I was able to find on passing parameters are: by-val, by-ref, and with the "out" modifier (which appears to be similar to by-ref.) Hope this helps.
jv
|
|
|
|
|
SteveUK wrote:
There must be some way of passing an object into a function and guaranteeing that the function does no change the object. This is a pretty basic and essential feature for writing robust code.
This is pretty much built into .NET. The following shows you:
Foo(object o)
{
o = null;
}
Main()
{
Object o = new Object();
Foo(o);
WriteLine(o);
}
<a TITLE="See my user info" href=http:
|
|
|
|
|
non-editable parameters is not supported by the CLS nor c#.
In order to simulate this, you can make a clone of the object you are passing in.
|
|
|
|
|
Command line parameters in C#? Possible? How?
|
|
|
|
|
Almost every C# program has a method that is called before anything else when the program starts up:
public static void Main(string[] args)
{
}
The "string[] args" parameter is an array of commandline parameters.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
That's great! I suspected something like that - I guess what knowed me of was the fact that app wizard generated code has "main" without any parameters.
|
|
|
|
|
Dear gurus,
How do you make text displayed in a MessageBox BOLD and COLORFUL?
Thanks a lot in advance
Khang Nguyen
|
|
|
|
|
Probably you need the windows API called MessageBoxEx
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
You can't do it with the plain old MessageBox class. If you want to have specially formatted text like that you're either going to have to make your own class or look around CP or the web for one that someone has already made.
- monrobot13
|
|
|
|
|
Thank you so much, gurus!
Khang Nguyen
|
|
|
|
|
Hi!
Can a windows form container control watch all input going to its components?
My use case:
I have a panel with a textbox inside. I need to know if the mouse was clicked inside that panel, even if it was clicked inside the textbox area.
Thanks!
|
|
|
|
|
I'm not sure if this is what you want, but you could simply setup the event handler for the textbox click to call the panels click event
- monrobot13
|
|
|
|
|
The thing is that inside that panel can be _anything_, varying at run-time. So I do not want to (or can’t) delegate to the child controls the detection and raise of the event.
|
|
|
|
|
I can't believe it. In the newest version of .NET, the tabcontrol still looks awefull, why don't they fix it at the MS House, it shouldn't be that much pane, or is it?
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
If you're looking for a nice TabControl (like the one in VS.NET) I'd suggest checking out the Magic Library at http://www.dotnetmagic.com[^]
- monrobot13
|
|
|
|
|
I know, but it seems so simple to fix
LPCTSTR Dutch = TEXT("Double Dutch ");
|
|
|
|
|
While MS seems to walk both sides of the fence sometimes, they aren't their to do the development for everyone. That's why they built VS in the first place - so people could develop stuff. Most of the controls MS provides are pretty low in functionality anyways - the TabControl is pretty nice for a freebie. And as you said - it's not a tough fix - so go do some development.
|
|
|
|
|
Maybe you can join our project, Universal GUI Library[^]. We are trying to create an improved control library for C++ and .NET.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Using the Media Player activex control with the latest version of directshow sdk I can't figure out how to play the file. Setting the filename is apparently done with the Url property. Also can't figure out how to seek...set the media player position.
|
|
|
|
|