|
myRichTextBox.SaveFile(myfilename, RichTextBoxStreamType.RichText);
HTH,
James
Simplicity Rules!
|
|
|
|
|
Ooh!
That was easy!
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
James, do you ever get stuck on a question, not even the "impossible-to-answer-questions" stop you?
I don't think I have ever seen you respond back saying anything like "...I'll have to check into that...." I'm not complaining, just thinking that you should consider writing a book.
Nick Parker
Actually, real programmers don't need the enter key- they just type in 00001101."
|
|
|
|
|
Nick Parker wrote:
do you ever get stuck on a question
Yes, I do; but not having a job gives me lots of free time for research in addition to coming up with my own ideas.
There are a few questions in this forum I've been stumped on or I was working on a solution then got distracted (as was the case of the Custom Serialization thread in the .NET forum).
Nick Parker wrote:
just thinking that you should consider writing a book.
On what? Most of my knowledge comes from MSDN and other books; and it wouldn't seem right to write a book based on other books. On top of that, I'm really not that good of a writer when it comes to complex topics.
James
Simplicity Rules!
|
|
|
|
|
James T. Johnson wrote:
On what? Most of my knowledge comes from MSDN and other books; and it wouldn't seem right to write a book based on other books. On top of that, I'm really not that good of a writer when it comes to complex topics.
I was only kidding around.
Nick Parker
Actually, real programmers don't need the enter key- they just type in 00001101."
|
|
|
|
|
Nick Parker wrote:
I was only kidding around.
Whew!
James
Simplicity Rules!
|
|
|
|
|
I have a webPage , I want to click on a button that will open a window (with the search reasult from my database),how can I do it?
thank u very much, sharon
|
|
|
|
|
I've been reading through the Data access block from MSDN and there are a couple of things that confuse me, besides the fact that there isn't any error handling.
There is quite a bit of use of using. Once the object goes out of scope of the using block, does the GC remove the object right then or is the IDisposable interface's Dispose just called, with GC deferred?
Cheers,
Simon
"Every good work of software starts by scratching a developer's personal itch.", Eric S. Raymond
|
|
|
|
|
SimonS wrote:
There is quite a bit of use of using. Once the object goes out of scope of the using block, does the GC remove the object right then or is the IDisposable interface's Dispose just called, with GC deferred?
When the object goes out of scope, Dispose is called from the IDisposable interface. Whether or not Finalization is suppressed depends on the implementation of Dispose. According to the contract it is supposed to be suppressed.
James
Simplicity Rules!
|
|
|
|
|
Hello Friends,
Can anyone knows any way of disabling virtual memory swapping of windows from C# application.
Actually in my application I'm asking for users password, so I want to make sure that it should not be swapped to Virtual Memory.
Thanks in advance.
Kalpesh
|
|
|
|
|
I think you are going way overboard in trying to keep the password secure. If someone can get on the machine to inspect the page file, there is nothing to stop them from installing a keylogger circumventing any security you built in anyway.
I think your best solution is something you're already doing, not writing the password to disk in the first place.
James
Simplicity Rules!
|
|
|
|
|
Can anyone explain me plz, How do i work with Assemblies with C#?
I apreciated your help
thanks
|
|
|
|
|
It's not quite clear what you're asking.
Assemblies are the unit of deployment/packaging in C#. If you write something like:
csc /target:library /out:lib.dll a.cs b.cs c.cs d.cs q.cs
all the files will get compiled and packaged into lib.dll.
To use the assembly from the command line, you use /r to reference. To use it from VS, you add it as a reference to the project.
If that doesn't help, please ask again.
|
|
|
|
|
With other word you could say: An assembly is an EXE or DLL, something that you can execute.... right?
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
Rickard Andersson wrote:
An assembly is an EXE or DLL, something that you can execute.... right?
Often, but not always. An assembly can be made up of multiple files that are all thought of as part of the 'assembly'. So, for instance:
A single-file assembly:
MyAssembly.dll
A multi-file assembly:
MyAssembly.dll
MyPic.gif
OtherPic.gif
CompiledModule.netmodule
The single-file assembly is just that - a completely self contained assembly. The multi-file assembly is an assembly that is made up of multiple files. The MyAssembly.dll contains an Assembly Manifest, which references the external files MyPic.gif,OtherPic.gif, and CompiledModule.netmodule as being part of this assembly.
VS.NET won't really let you explicitly build multi-file assemblies, but they can be easily built from the command-line compiler.
Anyway, the point of the matter is that an 'Assembly' is a logical, versioned unit of code and data deployment. Assemblies aren't always contained in one file.
--
Russell Morris
"WOW! Chocolate - half price!" - Homer Simpson, while in the land of chocolate.
|
|
|
|
|
Hello
I'm a newcommer here, and I would like to state that this is a great helpfull site. Thanks for all the contributers!!
I am trying to open a form from within an existing running form (both under the same namespace), E.g. an "About" popup.
I tried "Application.Run(new AboutWindow());"
Compilation ends successfully but when i press the designated button, the application crashes.
Ideas will be most welcome,
thanks all
Gilad
|
|
|
|
|
Use Form.ShowDialog to show the About form.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Wow...
What a popup answer...
Thanks a lot!!
Gilad
|
|
|
|
|
After spending a long time on a current VB project with 30 similar but different forms, I was looking at using c# and inherited forms to see how much easier it could be.
I have a base form with a tab control on it complete with two tabs that will be common to all inherited forms. e.g "General" and "Other Info"
What I want to do is add additional tabs between these inherited tabs on the inherited forms. This works ok in Visual Studio (ie. I can move my new tab to between the existing tabs) but when the project is executed, the new tab is put back at the end of the list again.
Is this a bug in VS or more, likely, a design limitation?
What is the best way to achieve this. I want to keep the GUI mode modification of the tab layout but it seems to be wasteful to have VS create the collection in InitializeComponents() only for me to immediately do the same thing again.
Cheers
Simon
|
|
|
|
|
simmotech wrote:
Is this a bug in VS or more, likely, a design limitation?
Just take a look at the code. It might be a GUI designer error. Maybe the code will throw more light on the issue
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
I have a picture in a picturebox and I would like to move it around within the bounds of the form. I like the idea of it changing directions when it hits the outer edge of the form. What is the best way to do this? I have this, but it really isn't doing a whole lot. Thanks in advance.
void MovePic()
{
for(int i = 0; i < this.Width; i++)
{
this.picbox.Top += 1;
this.picbox.Left += 1;
}
}
Nick Parker
Actually, real programmers don't need the enter key- they just type in 00001101."
|
|
|
|
|
You might want to creat VMove and HMove variables. So it would look like this:
void MovePic()
{
for(int i = 0; i < this.Width; i++)
{
this.picbox.Top += VMove;
this.picbox.Left += HMove;
}
}
Then when it hits an edge, just negate one of the variables.
|
|
|
|
|
Hi,
In C or C++,some structures are defined with union. How can
we rewrite these structure in C# so that we can use them as
parameters and pass them into API functions?
And, What's the correspondent type in C# to PVOID type in C?
Thanks in advance!
Angus Liu
|
|
|
|
|
ykliu wrote:
In C or C++,some structures are defined with union. How can
we rewrite these structure in C# so that we can use them as
parameters and pass them into API functions?
e.g.
union U
{
int x;
int y;
}
can be written in C# as
[StructLayout(LayoutKind.Explicit)]
class U
{
[FieldOffset(0)]
int x;
[FieldOffset(0)]
int y;
}
ykliu wrote:
And, What's the correspondent type in C# to PVOID type in C?
There are two equivalents of PVOID in C#
1. void* this is when you are using C# pointers. Something which you should never do.
2. IntPtr this is used to encapsultae unmanaged pointers. Use this in conjunction with Marshal.StructureToPtr, Marshal.AllocCoTaskMem etc. functions. Look up all the functions in Marshal class it would be very helpful.
|
|
|
|
|
Hi Rama,
Thank you very much, though, I don't understand all
of them, especially the Marshal part. I will keep
reading some document before asking another question.
Angus Liu
|
|
|
|