If Me.cmbgrade.Text = "F" Or Me.cmbgrade.Text = "F9" Or Me.cmbgrade.Text = "6" Then
MessageBox.Show("Please You Can Register An Applicant With A Fail Among Six Subjects", "Admission Process", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button3)
If Windows.Forms.DialogResult.OK Then
Me.btnsave.Enabled = False
Else
Me.btnsave.Enabled = True
End If
End If
If Else Statement
Page 1 of 14 Replies - 1784 Views - Last Post: 02 March 2010 - 10:13 AM
#1
If Else Statement
Posted 26 November 2009 - 06:02 PM
I am having this problem with my combo box.I dont want users to select any of the items F,F9 and 6 with the combo box so i am using this code to check that and if a user selects any of them, it should give him/her a message and then disable the save button unless he/she changes the Letter before it enables it ...........This only works for the disabling but not for enabling even if the text is chaged
Replies To: If Else Statement
#2
Re: If Else Statement
Posted 26 November 2009 - 06:22 PM
I suspect that it is because you are not collecting the result from the MessageBox.Show. This code is cut from the MSDN documentation.
then you need
Dim returnValue As DialogResult returnValue = MessageBox.Show(text, caption, _ buttons, icon, defaultButton)
then you need
If returnValue = Windows.Forms.DialogResult.OK Then ...
#3 Guest_elish*
Re: If Else Statement
Posted 01 March 2010 - 08:21 AM
how do i connect forms through combo box?for example:
i am to log in and im in the admin's account, i have to select through the combox the admins account then log in...
how do i connect it to the admin's form?
i am to log in and im in the admin's account, i have to select through the combox the admins account then log in...
how do i connect it to the admin's form?
#4
Re: If Else Statement
Posted 02 March 2010 - 07:55 AM
elish, on 01 March 2010 - 07:21 AM, said:
how do i connect forms through combo box?for example:
i am to log in and im in the admin's account, i have to select through the combox the admins account then log in...
how do i connect it to the admin's form?
i am to log in and im in the admin's account, i have to select through the combox the admins account then log in...
how do i connect it to the admin's form?
You just use the namespace of your other form. For example: AdminsForm.textbox.text. Is that what you are asking?
#5
Re: If Else Statement
Posted 02 March 2010 - 10:13 AM
You will have to determine from the combobox which login is being performed and then inside an if statement, show the appropriate form.
something like
Note: the code above is assuming form names and dis-regarding any other qualifications such as passwords. It is intended to show the basic If statement that I was referring to.
something like
If cboBox.Text = "Admin" then dim fAdmin as new frmAdmin fadmin.show else dim fUser as new frmUser fUser.show end if
Note: the code above is assuming form names and dis-regarding any other qualifications such as passwords. It is intended to show the basic If statement that I was referring to.
This post has been edited by CharlieMay: 02 March 2010 - 10:14 AM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|