Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1.         private void odpriČlanekToolStripMenuItem_Click(object sender, EventArgs e)
  2.         {  
  3.             // odpre dialog box ze takoj ko kliknem in ko nekaj izberem gre notr v if
  4.             if (openFileDialog1.ShowDialog() == DialogResult.OK)
  5.             {  
  6.                 // TextReader pac za branje fajla
  7.                 TextReader tr = new StreamReader(openFileDialog1.FileName);
  8.  
  9.                 // preberm vse iz fajla
  10.                 string vse = tr.ReadToEnd();
  11.                
  12.                 // zaprem text reader
  13.                 tr.Close();
  14.  
  15.                 // ustvarm clanek in not vrzem v richtextbox ta string
  16.                 Clanek clanek = new Clanek();
  17.                 clanek.MdiParent = this;
  18.                
  19.                 // WOOT?
  20.                 clanek.Show();
  21.                
  22.             }
  23.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement