but i need to know how and where to set dialogresult=OK?
hi john
i ve used application events as u said..
but i reall don no to use show dialog..
here is my code..plz take a view
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
lblMsg.Text = ""
Try
If Me.tbUName.Text <> " " AndAlso Me.tbPassword.Text <> " " Then
Dim dsLogin As New DataSet()
'Assigning the Login Result to Dataset
dsLogin = objUserMgmt.RetreiveLogin(tbUName.Text.Trim(), tbPassword.Text.Trim())
If dsLogin.Tables.Count > 0 Then
If dsLogin.Tables(0).Rows.Count > 0 Then
'show welcome page
strLoginName = dsLogin.Tables(0).Rows(0)("loginname").ToString()
strPassword = dsLogin.Tables(0).Rows(0)("password").ToString()
strMenuId = dsLogin.Tables(0).Rows(0)("menuid").ToString()
struserName = dsLogin.Tables(0).Rows(0)("name").ToString()
MsgBox("Parikshaa Welcomes " & struserName, MsgBoxStyle.Information, "Parikshaa")
'this is the form i shud navigate
'------------------------------
FrmBoardUniversity.Show()
Else
lblMsg.ForeColor = Color.Red
lblMsg.Text = "UserName and Password Do Not Match"
End If
End If
Else
lblMsg.ForeColor = Color.Red
lblMsg.Text = "UserName and Password Cannot be Empty"
tbUName.Focus()
End If
Catch ex As Exception
MsgBox(ex.InnerException)
Finally
tbUName.Text = ""
tbPassword.Text = ""
End Try
Me.Close()
End Sub