Solved

windows forms MsgBox function OK button click event

Posted on 2016-08-04
1
94 Views
Last Modified: 2016-08-04
Hi experts,

I have a Windows Forms application using VB as the language.

I have a windows forms page with has some textboxes and a submit button.

If you fill out the wrong data in the textboxes I have some vb code that validates the textboxes for good data.

If it's bad data I'm using MsgBox function. To display a MsgBox window with the errors.

I'm not familiar with the MsgBox function.   Right now I believe I have MsgBoxStyle property set to the MsgBoxStyle.OkOnly
Which displays an OK button in the window. If I click the OK button the windows closes.

MsgBox Function (Visual Basic)
https://msdn.microsoft.com/en-us/library/139z2azd(v=vs.90).aspx

If I want to add something to the MsgBox OK button click event.

Anyone know how to access the click event for MsgBox OK button?
0
Comment
Question by:maqskywalker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 41743263
You cannot. The ok button is just to acknowledge the message and close it. If you want to add something, you just need to add the code for this something right after the msgbox statement. The MsgBox is blocking until the user actually click the ok button.
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Power PDF (http://www.nuance.com/for-business/document-imaging-and-scanning/power-pdf-converter/index.htm) is the newest product from the Document Imaging division of Nuance Communications (http://www.nuance.com/). It is available in two editions — …
In a previous article published here at Experts Exchange, Signature Image with Transparent Background (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_12380-Signature-Image-with-Transparent-Background.html), I explained how to cre…
In this third video of the Xpdf series, we discuss and demonstrate the PDFtoText utility, which converts PDF files into plain text files. Download and install the software.: You may have already downloaded and installed the Xpdf tools while watching…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question