good possibility is that ".ToString()" is being called on the control.... ;)
Printable View
good possibility is that ".ToString()" is being called on the control.... ;)
?Quote:
Originally Posted by TheCPUWizard
as you wishQuote:
Originally Posted by JonnyPoet
actually, i now changed from opening it in IE to displaying it in my window. And now the window is actually white; whatever i have written in my txtbox.
why?
i discovered that if i right-click my browser window and choose "display source code", i get "System.Windows.Forms.RichTextBox, Text: 12345" (the content of txtBix1 being "12345")
how do i get rid of the "System.Windows.Forms.RichTextBox, Text:", and how do i display anything in the browser window?
Looked through the code you posted (please use zip, not rar files in the future, many here do not have WinRAR or equivilant so you end up limiting yourself...)Quote:
Originally Posted by dahwan
I did not see any reference to "richtxtbox1" in the code (there are references to "txtbox1")... :confused: :confused:
My previous post was related to the fact that the default implementation of "ToString()" (which is supported by EVERY object, is to return the type name as a string..
Thx for posting your code
There are some probems with it easy to handle
a) USE ZIP instead of RAR files
b) The Resources are missing
c) Never use Pathes in your Program no other one will be able to use it as he doesnt have the same pathes as you have so e.g. all your pictures needs to be in the resources File
d) Use the satndard IDE and the standsard project files so nobody needs to rearrange all your project files and to have extra work for arranging them and creating a project file first.
Sorry I myself have no experience with html so I cannot answer your question. Your request was unclear for me, as I thought you are using a normal richtextbox anywhere in the program and you get an errormessage, but now you drescribed better and I can verify your problem, but here you ned some advice from a programmer with web experience.
you don't need no friggin web experience. i just wana know why i dont get all the text in the rich text box when i save its content to a file. ANY file. in my case html, but allso .txt files, and even .argawriu files.
Sorry your code is totally confusing. As you are not using the satndard way of deviding in Partial Classes using a designer, the self written design is mixed up to normal codepages and the events normally added to the forms code where they are done is in a separate document ??? As I said in all posts before. GET ON STANDARDQuote:
Originally Posted by dahwan
LEARN TO USE AND UNDERSTAND DESIGNER !
You have e.g created a new richtextbox as Textbox1 twice in your program, you have created an XML document, but you never use it, ?
So delete the second one
You are telling that you are using a namespaceCode:/****************************** CREATING THE TEXTBOX ******************************/
//txtbox1 = new RichTextBox(); // Create the textbox // NO ITS DONE BEFORE IN Your CONSTRUCTOR ( You did it there too )
txtbox1.BackColor = Color.LightGray;
in every document but I have non of such namespace anywhere. Where it is, where are the missing resources ?Code:using WebSlinger.Properties;
...
Streamreader and Streamwriter are Resources which are normally opend, used and instantly closed and disposed So why you do them as private fields. Here you have a typical misunderstood again of how to use lifetime of fields, objects... When you only need to read or store data then you only declare the reader and writer in the method they are used and then closing and finished.
Otherwise in your program try to save any text then open it again and then change it and try to store again. You will fail and get error that you cannot do as the file is used by another. Its still in use by your open still reader, so you cannot rewrite again to him
So please in every Event / Method what else, where you have a StreamReader or a SteamWriter do like that
Delete the following Fields in your EditorWindow classCode:// Use local Objects only instead of private fields
StreamWriter SW = File.CreateText(saveResult.FileName);
SW.Write(txtbox1.Text);
SW.Close(); // add this to close the Resoure
You cannot keep them open all over the time the program runs and the EditorWindow is your mainwindowCode://private StreamReader SR;
//private StreamWriter SW;
Additional: If you have an editorwindow and a new Page is added then it normally has to turn to a white Background,otherwise who should know that he is allowed to type to a dark backgroundimage ?
Also in that way use the STANDARDS which are used in e.g.WORD, PDF.s ... How a user should work with it. He is awaiting usage as he knows from other programs. :mad:
Jonny,
Good comments...Except the following is much better:
Note that you do not need to explicitly close the SW, and that this code is 100% reliable in the event of exceptions.Code:// Use local Objects only instead of private fields
using (StreamWriter SW = File.CreateText(saveResult.FileName))
{
SW.Write(txtbox1.Text);
}
Yes thx a lot, for mentioning that. As you know I'm just learning C# too... but :blush: I had studies this .. so I should have known ( end of blush):DQuote:
Originally Posted by TheCPUWizard
Yea, I was only going about his code, a bit going crazy about permanent out standard problems not only regarding coding, also in run time habits. e.g. you start the program you get an MDI looking interface with a gray background. If you use 'Menue-> New' nothing happens. I was looking around for about 15 minutes studying his code what and where he would have an editorwindow. Then I found out - its there from the beginning but gray all the time just as the background of an MDI when no child is activated.. oh goodness. Hihi
But I havn't known that using 'using' doesn't need to close it at the end. Must have overseen this, need to have a look into my book again. :thumb:
Yeah, i liked that gray color :D
does anyone know why i get that text in the start of the run-file yet? I allso noticed that if i have longer texts, all i get is the start of the text followed by "..."
which- is kind of annoying =P
Thats not the answer I expected to get. But in my badest dreams I suspected to get an answer like that. - From a nordic revolutionary. :p programmer :DQuote:
Originally Posted by dahwan
Which text in -what do you mean with run-file ?Quote:
Originally Posted by dahwan
First correct all your troubles then test again. Then tell me exact the steps you are doing and where in which form / file whatever you get which respond ?? Sorry Your request is ununderstandable.
oh my... I am talking about the problem I've had for the last couple of pages. read it through, its still not fixed
dahwan,
Jonny's point (which I agree with) is that your code is structured in a way so radically different than standard conventnions, that there is a good possibility the this may be part of your problem. If if it is not the cause, it makes looking for the problem much more difficult, resulting in people not looking at it (I stopped as soon as I could not find a variable with the name you refered to).
If you like the grey color, then set that in the color scheme for YOUR computer, but do not include it in the program. Windows applications should follow the established color conventions. If I want to set my desktop parameters for purble characters on a chartruse background within a SDI/MDI window, then your program should respect that (which is the default behavior).
Your utilization of partial classes is also unconcentional. The accepted use is to divid a class into 2 sections, one of which is automatically generated by some process (and thus overwritten or modified by some process other than user edits.
Multiple creations of your textbox as Jonny pointed out are also not conforming to standard practices. I could continue the list, but you should get the pooint.
Take the time to re-write your application so it is clean and conformant to generalized coding standards. The see if the problem still exists. If it does, then begin reducing your program down to the ultimate bare bones that will still reproduce the program. Often this reduction will reveal the problem.
If you are still stuck once completing this process, then post a new version of the code along with the exact steps to reproduce it, and I am confident someone will take a look.
Good Luck.
ps: If I download a poster's .ZIP file, and open the .sln file, and get any load or compile errors (unless the posting is about load or compile errors), then I immediately stop looking at that threadm since the poster could not take the time to post a valid reproduction.
This is a similar point then other bad habits of different people e.g. not to use codetags or like in that case eevn not to include a .sln file, no resources and using a .rar instead of standard .zip as usual in this forum. I can agree wiz you wiz and also will no longer accept such files.Quote:
Originally Posted by TheCPUWizard