title: How do I read a text file to display in richedit and show a message when this succeeds?
body: <p>Below is my Perl code. I need help with:</p>
  
  <ol>
  <li><p>how to display the output into richedit when loading a text file containing a 100 line by line name list.</p></li>
  <li><p>after displaying the output in richedit then a small message window (popup window) will come out and tell me "your name list was successfully loaded".</p></li>
  </ol>
  
  <hr>
  
  <pre><code>use Win32::GUI;
  
  $Win = new Win32::GUI::Window(
      -left   =&gt; 341,
      -top    =&gt; 218,
      -width  =&gt; 300,
      -height =&gt; 300,
      -name   =&gt; "Win",
      -text   =&gt; "Open File Read and Display Popup"
  );
  
  $Win-&gt;Show();
  
  $Win-&gt;AddTextfield(
      -text   =&gt; "Load Your File TXT Here",
      -name   =&gt; "Textfield_1",
      -left   =&gt; 4,
      -top    =&gt; 24,
      -width  =&gt; 278,
      -height =&gt; 20,
  );
  
  $Win-&gt;AddButton(
      -text       =&gt; "Click Here To Load",
      -name       =&gt; "Button_1",
      -left       =&gt; 6,
      -top        =&gt; 48,
      -width      =&gt; 275,
      -height     =&gt; 21,
      -foreground =&gt; 0,
      -onClick    =&gt; \&amp;Load1,
  
  );
  
  $Win-&gt;AddRichEdit(
      -text   =&gt; "",
      -name   =&gt; "RichEdit_1",
      -left   =&gt; 5,
      -top    =&gt; 72,
      -width  =&gt; 275,
      -height =&gt; 169,
  );
  
  $Win-&gt;AddStatusBar(
      -text   =&gt; "",
      -name   =&gt; "StatusBar_1",
      -left   =&gt; 0,
      -top    =&gt; 248,
      -width  =&gt; 290,
      -height =&gt; 17,
  );
  
  Win32::GUI::Dialog();
  
  sub Win_Terminate {
      return -1;
  }
  
  sub Load1 {
  
      my $file1 = Win32::GUI::GetOpenFileName(
          -owner =&gt; $Win,                   # Main window for modal dialog
          -title =&gt; "Load Name List ...",
  
          # Dialog title
          -filter =&gt; [                      # Filter file
              'Name List(*.txt)' =&gt; '*.txt',
              'All files'        =&gt; '*.*',
          ],
          -directory =&gt; ".",                # Use current directory
      );
  
      # Have select a file ?
      if ($file1) {
  
          # Load file to animation control
          $Win-&gt;Textfield_1-&gt;Text(
              $file1);
      }
  
      # Or an error messagebox with error.
      elsif (Win32::GUI::CommDlgExtendedError()) {
          Win32::GUI::MessageBox(0, "ERROR : " . Win32::GUI::CommDlgExtendedError(), "GetOpenFileName Error");
      }
      $Win-&gt;{Button_1}-&gt;Text('Edit');
      $file1 = 1;
  }
  </code></pre>