Solved

VB.Net - Excel Spreadsheet and MessageBox

Posted on 2013-06-07
3
407 Views
Last Modified: 2013-07-10
Good Day Experts!

I have a little application here that ouputs an Excel spreadsheet.  I have added functionality to email and save automatically.  However, I need to be able to review the figures in the spreadsheet before emailing.  So, I put a messageBox in to temprarily stop processing to remind the User to review the figures.  

Only issue I have is when the messageBox pops-up it is behind the spreadsheet.  How can I make it be in front?

Here is my code for the MessageBox:

Dim Result As DialogResult = MessageBox.Show("Review the figures on the spreadsheet. Click Yes to save/auto-email or No to re-run.", "Check Values", MessageBoxButtons.YesNo)

Thanks,
jimbo99999
0
Comment
Question by:Jimbo99999
3 Comments
 
LVL 1

Accepted Solution

by:
jay813 earned 250 total points
ID: 39230776
You could create a form that looks like a message box, change its .topmost property to true. That way you could also customize your buttons to say "Email" rather than having a yes/no dialog. Just some food for thought..
0
 
LVL 10

Assisted Solution

by:adriankohws
adriankohws earned 250 total points
ID: 39231061
Yes, like what jay813 said, you can do that. Otherwise you have to write your own class message box so that you have topmost property to use.

There's also one way to try, make sure your application is on focus before calling the messagebox. Messagebox is not the topmost only when your application has actually lost focus. (Maybe the Excel application is focus during that time).

Actually if you were to ask me, I found the flow a bit weird. You should try to consider other flow, for example, inform the user before Excel even started, just a recommendation...
0
 

Author Comment

by:Jimbo99999
ID: 39239307
Thanks for the feedback, I will try it.  

Previous flow was to generate the report.  I had to look at the figures on the report and if all the checks matched then we were good.  If they did not match I had to figure out in db why then repair and re-run report. Once report is good then it is emailed in Outlook.

Now we want to auto email it through the program in event we forget to manually do it in Outlook.  So I was using the messageBox to temporarily stop code execution to review the figures.  If figures match I hit continue on the messageBox and the program sends email.
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

803 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