2 Replies - 1213 Views - Last Post: 18 February 2012 - 06:32 PM Rate Topic: -----

#1 BlankGuy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 14-February 12

VB.Net Mdi Notepad?

Posted 18 February 2012 - 06:20 PM

I've been trying make a mdi notepad that can start up new instances of a "note" which is unique from the other notes as in you can save/change/cut/copy/paste in the individual notes without changing the properties of the other notes..something like a tabbed notepad but instead of tab control i have a mdi container. but i can't make it work. does anyone have an idea how i could code this?

this is my code so far -

 Imports System.Windows.Forms

Public Class MDIParent1
    Private m_ChildFormNumber As Integer
    Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs) Handles NewToolStripMenuItem.Click, NewToolStripButton.Click, NewWindowToolStripMenuItem.Click
       
        Dim ChildForm As New System.Windows.Forms.Form
        
        ChildForm.MdiParent = Me

        m_ChildFormNumber += 1
        ChildForm.Text = "Note " & m_ChildFormNumber

        ChildForm.Show()
        Dim MdiRichTextBox As New RichTextBox()
        With MdiRichTextBox
            .Dock = DockStyle.Fill
            .TabIndex = 0
        End With
        ChildForm.Controls.Add(MdiRichTextBox)
        AddHandler CutToolStripMenuItem.Click, _
                    AddressOf MdiRichTextBox.Cut
        AddHandler CopyToolStripMenuItem.Click, _
                    AddressOf MdiRichTextBox.Copy
        AddHandler PasteToolStripMenuItem.Click, _
                    AddressOf MdiRichTextBox.Paste
        AddHandler CutToolStripButton.Click, _
                   AddressOf MdiRichTextBox.Cut
        AddHandler CopyToolStripButton.Click, _
                    AddressOf MdiRichTextBox.Copy
        AddHandler PasteToolStripButton.Click, _
                    AddressOf MdiRichTextBox.Paste

    End Sub 


problem with it is that whatever you cut/copy/paste in one mdi container richtextbox, it automatically cuts/copies/pastes in the other richtextbox controls in the other containers..
p.s. sorry if i'm not being clear it's hard to explain. >.<

Is This A Good Question/Topic? 0
  • +

Replies To: VB.Net Mdi Notepad?

#2 DimitriV  Icon User is offline

  • Das kann nicht sein
  • member icon

Reputation: 544
  • View blog
  • Posts: 2,637
  • Joined: 24-July 11

Re: VB.Net Mdi Notepad?

Posted 18 February 2012 - 06:26 PM

Well need to see the code for cut/copy/pasting.
Was This Post Helpful? 0
  • +
  • -

#3 BlankGuy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 14-February 12

Re: VB.Net Mdi Notepad?

Posted 18 February 2012 - 06:32 PM

View PostjimmyBo, on 18 February 2012 - 06:26 PM, said:

Well need to see the code for cut/copy/pasting.


the handlers reference these subs:

  Private Sub CutToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CutToolStripMenuItem.Click


    End Sub

    Private Sub CopyToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles CopyToolStripMenuItem.Click
        
    End Sub

    Private Sub PasteToolStripMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) Handles PasteToolStripMenuItem.Click
        
    End Sub 


the code for copying/pasting/cutting is mdi.richtextbox.cut/copy/paste but it handles all of the richtextbox instances so if i cut in one container it will cut in all the containers that have mdirichtextbox open. am i making sense? or is there another way to program this. :s
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1