Solved

windows forms MsgBox function OK button click event

Posted on 2016-08-04
1
73 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Update 21-May-2015: I temporarily removed the source code and the code snippets to make major changes to the program. Regards, Joe A recent question here at Experts Exchange piqued my interest, so I decided to provide a thorough solution and publ…
Update 21-May-2015: I temporarily removed the source code to make major changes to the program. Regards, Joe INTRODUCTION This article presents a solution to a question (http://www.experts-exchange.com/Programming/Installation/Q_28396542.html)…
Sometimes we receive PDF files that are in the wrong orientation. They may be sideways or even upside down. This most commonly happens with scanned or faxed documents. It is possible to rotate the view of these PDFs with the free Adobe Reader produc…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

756 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