I have 2 form there are form 1 and form 2

my program current situation is when user click delete it will pop up a login form. When user click cancel button from login form the data on the database will be delete

login_form.PNG

when user click cancel it will restart program and delete my data

the program i would like to write on cancel button is when user click the cancel, form 2 will refresh and the data on the database will not be delete

this is the my program running current situation

A.PNG

InkedB_LI.jpg

C.PNG

i am using vb.net to develop my program

login form cancel button program

can soomeone help me take a look, can someone pls give me a comment

Recommended Answers

Although you should never code

If True Then Button1.Enabled = True

which is equivalent to

Button1.Enabled = True
Jump to Post

All 4 Replies

You should call login form before user can actualy edit data.
Maybe to use checkbox and buttons disabled on formload
code example for check box

If True Then Button1.Enabled = True

Although you should never code

If True Then Button1.Enabled = True

which is equivalent to

Button1.Enabled = True

I ment to write something like this:

If CheckBox1.CheckState = CheckState.Checked Then
Then Button1.Enabled = True
Else
Button1.Enabled = False
End If

Sorry for my first post

You could do that, or you could just do

Button1.Enabled = CheckBox1.Checked

Why write five lines of code when one is shorter and clearer?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.