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

theLizardPosted Aug 29, 2010, 6:49 PM
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 SarkarPosted Aug 29, 2010, 10:32 PM
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! :)
theLizardPosted Aug 29, 2010, 6:49 PM
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 SarkarPosted Aug 29, 2010, 12:10 AM
Tanmay SarkarPosted Aug 28, 2010, 11:59 PM
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!
Sam HobbsPosted Aug 28, 2010, 11:44 PM
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.
theLizardPosted Aug 28, 2010, 10:58 PM
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..
Tanmay SarkarPosted Aug 28, 2010, 10:15 PM
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?]
theLizardPosted Aug 28, 2010, 6:26 PM
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.