How to create confirmation dialog box with delay OK button?

I'm developing windows forms application in
I must allow users to delete some records from database but I want to make it really unpleasant :)
So there must be confirmation dialog box with two buttons.
One of them will be OK and the other one will be Cancel ( I decide which is which based on Random number generator :) )
But I want to enable OK button after few seconds for example 5 seconds during this time there will be
OK (5), OK (4) , OK(3) , OK(2), OK(1), OK and now OK button is enabled.
I know how to do this using form and 2 buttons and Timer object.
But how I can return the result (true or false) to the main form?

I want to do something like MsgBox
Please help me with this problem
Best Regards
LVL 11
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

f_o_o_k_yConnect With a Mentor Author Commented:
Solution is to set dialogresult property just before closing form.
and in main form use showDialog() instead of show()
You can use a Timer from (eg the system.threading) class which updates every x seconds the text of the button.
f_o_o_k_yAuthor Commented:
Maybe I didn't ask question to creally.

I know how to do everything (buttons, cuntdown, random position of OK button) except one thing.

How can I get in main form value from this confirmation form.

Example belowe shows what I want to do but it's with MsgBox .
I need to do this but instead using MsgBox I want to use my frmConfirm.vb
Best Regards
' frmMain.vb
Dim answer As MsgBoxResult
answer = MsgBox("Are you sure?", MsgBoxStyle.YesNo, "Warning!")
If answer = MsgBoxResult.Yes Then
End If

Open in new window

All Courses

From novice to tech pro — start learning today.