Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Form deletes painted picture, and getfocus problem

Posted on 2001-09-09
4
Medium Priority
?
193 Views
Last Modified: 2010-05-18
Hi,

I have an application with MDI form, and a few child forms. I have a form "frmPicturePreview", in which I can call another form: "frmAddText" to add text to the picture preview form. The picture is being painted into frmPicturePreview with the paintPicture method. The problem is that when I call the frmAddText, it behaves like an erasure, in a way that if it's over the frmPicturePreview it erases the picture. Weird, huh? Does anyone know about this problem (bug?) and how to fix it?

My other problem is the "GetFocus" method. It looks like just clicking the form title doesn't fire this method. Or even clicking on the form itself. How can I know if the form is the active one? I tried to use MDIForm1.ActiveForm, but it kept telling me that I have an error.

Thanks a lot!
0
Comment
Question by:meravkn
[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
4 Comments
 
LVL 38

Expert Comment

by:PaulHews
ID: 6469551
Windows applications only repaint when it is necessary (when they are minimized and restored or when they are covered by another window.)  When you are drawing on a form using paintpicture, your application doesn't know it has to maintain that drawing if the form needs to be repainted.  There are two ways to fix this.

in form load:

frmPicturePreview.AutoRedraw = True

or in the Paint event for your form, put in a call to the code that does the paintpicture.

0
 
LVL 9

Accepted Solution

by:
Valliappan AN earned 100 total points
ID: 6469808
For your getfocus problem, you could try the activate event of form.

And to find the active form name, hope can use, Screen.ActiveForm.Name,

Hope this helps.
0
 
LVL 1

Author Comment

by:meravkn
ID: 6472696
Thank you very much, I requested to split the points between two of you.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 6472912
I have reduced the points in half.  Now you can accept one of the experts comment as an answer and post another question in this topic area for the other for the other 25 points.

Thank you
Computer101
Community Support Moderator
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

718 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