Private Sub mnuNewRandom_Click(ByVal sender As System.Object, ByVal e _
                As System.EventArgs) Handles mnuRandom.Click
    Dim MyRandom As New frmRandom()
    Dim FileName As String

    rtbOutput.Visible = False

    With SaveFileDialog1
      .Filter = "Random files (*.dat)|*.dat" & _
                "|All Files (*.*)|*.*"
      .FilterIndex = 1
      .InitialDirectory = "C:\Temp\"
      .Title = "Select Random File"
    End With

    Try
      If SaveFileDialog1.ShowDialog() = DialogResult.OK Then
        FileName = SaveFileDialog1.FileName
        Dim MyFile As FileStream = New FileStream(FileName, _
                 FileMode.Create, FileAccess.ReadWrite)
        MyFile.Close()
        MyFile = Nothing
      Else
        Exit Sub     ' Użytkownik nie chce kontynuować...
      End If
    Catch
      MessageBox.Show("Could not access file")
    End Try
    MyRandom.FileName = FileName
    MyRandom.Show()

  End Sub
