private void button1_Click(object sender, System.EventArgs e)
{
string sFullPath = string.Empty;
string sFileName = string.Empty;
if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
{
sFullPath = openFileDialog1.FileName;
sFileName = System.IO.Path.GetFileName(sFullPath);
}
}
private void button2_Click(object sender, System.EventArgs e)
{
string sFullPath = string.Empty;
if (this.folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
sFullPath = folderBrowserDialog1.SelectedPath;
}
}
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Dim formRequired As Form = ExistsForm(Me, GetType(SubForm))
If formRequired Is Nothing Then
Dim sub1 As SubForm= New SubForm()
sub1.MdiParent = Me
sub1.Show()
Else
formRequired.Activate()
End If
Catch ex As Exception
MessageBox.Show(Me, String.Format(ex.Message, Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error))
End Try
End Sub
Public Function ExistsForm(ByVal mainForm As Form, ByVal typeForm As Type) As Form
Dim formRequired As Form = Nothing
For Each form As Form In mainForm.MdiChildren
If form.GetType() Is typeForm Then
formRequired = form
Exit For
End If
Next form
Return formRequired
End Function
Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim newTabPage As System.Windows.Forms.TabPage = New TabPage()
newTabPage.Location = New System.Drawing.Point(4, 22)
newTabPage.Name = "newTabPage" & iNumTapPages
newTabPage.Size = New System.Drawing.Size(304, 246)
newTabPage.TabIndex = iNumTabPages
newTabPage.Text = "tabPage " & iNumTabPages
Me.tabControl1.Controls.Add(newTabPage)
iNumTabPages += 1
End Sub