Solved

SSPanel problem

Posted on 1998-07-30
4
203 Views
Last Modified: 2010-05-03
A curious little problem, but no doubt someone else has seen it before and found a solution.

Ok, if you create two forms, one with just a command button on it (form2) and then form1 with an SSpanel control (make it the size of a regular toolbar button for convenience), and then put a picture into an image control and place it in the SSpanel.

Right, now the object is to load/show form2, which will always work, but slightly differently according to if you click the image within the SSpanel, or the SSpanel itself.

Put code into the click event of the SSpanel to load form2, (show it using vbmodal) and then put code into Image1_Click to call SSpanel_Click event (saves loading the form from two differnt places).
Now what happens is that if you click on the image control then everything is fine and as it should be, but if you click on the SSpanel itself then the mouse behaves very oddly, as though it is still on form1 (although only for one click), and without clicking the mouse once (anywhere, on form1 or form2) then you wont be able to click the command button on form2. Basically it doesn't seem to have recognised the vbmodal status of form2 until you click something again. The problem with this is that not only is it annoying, but if the mouse is in the same position as the SSpanel when you make the second click, then you'll get an error, because you're trying to show an already vbmodalised form. On the other hand, if you show the form without being vbmodal then no problem.

Things I've tried :
a) deleting the code and starting again
b) doing a DoEvents in just about every possible place
c) calling an empty Form_Click event where I thought
   it might help.

By the way, if you break out of the code and try to F8 through it then you wont see the problem, because strangely enough this will actually cause it to work.

Any comments welcome, but grateful if you don't lock the question up unless you really do have a solution. Like I said it's very simple to emulate the problem, so maybe try it yourself first if you think your solution will work.

Thanks in advance. Dave
 
0
Comment
Question by:dgb001
  • 2
4 Comments
 
LVL 1

Author Comment

by:dgb001
ID: 1467285
Edited text of question
0
 
LVL 6

Expert Comment

by:clifABB
ID: 1467286
A strange problem.  I wonder if MS (or Sheridan) knows about this?
0
 
LVL 1

Accepted Solution

by:
SeanGiles earned 40 total points
ID: 1467287
This is a bug with the panel. In the panel click event disable the panel, show the second form modally and then re-enable the panel.  If your using vb5 the regular command button has a graphical mode that lets you display images.

0
 
LVL 1

Author Comment

by:dgb001
ID: 1467288
Thankyou Sean, that does indeed solve my problem, though I must admit as to being rather curious of its cause.

and Cliff, thanks for your comment, yes I wonder too if it is actually a documented bug, it is very strange that it should behave this way.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

919 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now