Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

disable menu bar with out going gray?

Posted on 2000-04-15
7
Medium Priority
?
228 Views
Last Modified: 2010-05-02
When my application prints and simultaneously the user clicks on File and Print from the menu bar and trys to print again befor the first one is done it causes an error. I can disable the File menu but this case's the word "File" to go gray which look's strange. If I disable the entire form it loose's focus. How can I keep the user from clicking on the File menu during printing. If I make the form a child in a MDI, it can be disabled with out loosing focus. Is that the only way? I am using VB 4 16 bit and VS Printer 1
0
Comment
Question by:davidb
[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
  • 3
  • 2
  • 2
7 Comments
 
LVL 28

Expert Comment

by:AzraSound
ID: 2719573
how bout create a boolean variable called Print

set it to True when printing begins

then in mnuPrint_Click function first test if Print = True and if it is exit the sub
0
 
LVL 14

Accepted Solution

by:
wsh2 earned 800 total points
ID: 2720289
Azra:
You don't need the boolean variable.. just directly set

mnuPrint.Enabled = False

then only the Print subitem on mnuFile will be grayed out.. <smile>.
--------------------------------------

Another approach to this problem would be to make a seperate form (frmPrint).. place a label stating "Printing" and a Progress bar. Before you print.. do a frmPrint.Show vbModal. While you are in your print loop, update the progress bar. When the print is finally done, just execute a UnLoad frmPrint to make the form disappear.

The frmPrint.Show vbModal locks the focus on frmPrint and the user will not be able to do anything in the program until frmPrint goes away.

0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2720585
i was under the impression he didnt want anything grayed out.  again my assumptions lead me to...well they dont really take me anywhere. sorry for the confusion.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 14

Expert Comment

by:wsh2
ID: 2720961
Azra:
Please don't take my comment as being critical.. Your code is absolutely perfect to that assumption.. <smile>.

I interpreted the question differently.. and as such, directed my comment to you so as to add to your worthy comment rather than to detract from it. My solution.. is a different one than yours.. and I trust that the questioner is able to discern the difference between your solution (boolean flag and/or mnuItem.Disabled = False) and mine (vbModal Form).. <smile>.
0
 

Author Comment

by:davidb
ID: 2756077
Adjusted points from 100 to 200
0
 

Author Comment

by:davidb
ID: 2756078
I am trying to use your suggestion of frmPrint.Show vbModal, but the program stops at that line of code and doesn't continue to the printing code until the frmPrint is closed.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2756099
how about creating a boolean variable IsPrinting ...    =oP
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

604 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