How we load multiple text file in our simple notepad application?
We can build a simple notepad just using rich text box or text box and open, save dialog. but in single time we only open a single file. If i open "a.txt" then when i try to open "b.txt" first file will gone.
I want to try both file will be there with separate tab.(like Notepad++).
How i do that?
First i think the rich text box will be in different form & when open any file or create new file that form will appear. But I am not implement it as it not looks like Notepad++.
if we use Tab control then i think, the close button will not appear in tab.
Please help me!
Thank you in advance!
Loading


theLizardRank #1,079 · 1.8K reputationPosted Aug 29, 2010, 2:49 PM EDT
I have also created a Tab based system using C++ see example.
In this example (just a screen shot) the act of clicking on a tab or in a rich edit box sets the one an only open / close menu option to act on the tab or rich edit selected.
If you open a file, then the file is opened in the rich edit box of the tab selected and the status bar shows the file path and name. Ctrl + S will save the active tab document.
Doing these things is not difficult, you just need to develop the ideas.
theLizardRank #1,079 · 1.8K reputationPosted Aug 28, 2010, 2:26 PM EDT
It does not use tabs but manages forms in an MDI application, using tabs is not that much different, instead of managing forms you manage tabs.
Tanmay SarkarRank #1,407 · 1.2K reputationPosted Aug 28, 2010, 6:15 PM EDT
Unfortunately i am unable to post image in this thread, so I upload 3 images your 2 (images) & what i am looking for 1 (image) .
Thanks for your valuable time to help me. But i want something different.
Please help me!
Thank you in advance!
[Any body can tell me how upload image in thread?]
theLizardRank #1,079 · 1.8K reputationPosted Aug 28, 2010, 6:58 PM EDT
If you just want a form with a tab control just use the TabControl.TabPages.Add("the name of the file you just opened") then if you want to save a file use the tab page text property.
Using a tab control will be a lot easier than managing forms in my example, you just need to work out how to do it but the example gives you an idea..
Sam HobbsRank #107 · 20.5K reputationPosted Aug 28, 2010, 7:44 PM EDT
There is a sample C++ program called Superpad that is like a multiple-document version of Notepad. I am not suggesting you use C++ but I am surprised that there is not a C# version of it.
Tanmay SarkarRank #1,407 · 1.2K reputationPosted Aug 28, 2010, 7:59 PM EDT
And it's true, tab control have no that option. Where it appreciate that every tab must contain a close button. And it give a better look.
MDI is good but when more child are maximized, the looks are not better (i think).
That's why i upload 3 images in my previous post.
Thank you!
Tanmay SarkarRank #1,407 · 1.2K reputationPosted Aug 28, 2010, 8:10 PM EDT
theLizardRank #1,079 · 1.8K reputationPosted Aug 29, 2010, 2:49 PM EDT
I have also created a Tab based system using C++ see example.
In this example (just a screen shot) the act of clicking on a tab or in a rich edit box sets the one an only open / close menu option to act on the tab or rich edit selected.
If you open a file, then the file is opened in the rich edit box of the tab selected and the status bar shows the file path and name. Ctrl + S will save the active tab document.
Doing these things is not difficult, you just need to develop the ideas.
Tanmay SarkarRank #1,407 · 1.2K reputationPosted Aug 29, 2010, 6:32 PM EDT
My problem is solved but if it possible to add close button then it will be more nice job.
Thanks for your long support.
Thank you! :)