Solved

background form

Posted on 2002-07-26
9
160 Views
Last Modified: 2010-04-04
I've using this code on my forms OnPaint:

SetWindowPos(Handle, HWND_BOTTOM, Left, Top, Width, Height, SWP_SHOWWINDOW);

this causes my form to be in the background, just infront of the desktop.

But, if i drop a TListView on the form, and makes it alClient, it won't worke more! Why?
0
Comment
Question by:easysoft_studios
  • 5
  • 4
9 Comments
 
LVL 7

Accepted Solution

by:
Cynna earned 100 total points
ID: 7181159
easysoft_studios,

> But, if i drop a TListView on the form, and makes it alClient, it won't worke more! Why?

Simple - forms OnPaint event is not getting fired. Form is completly covered by ListView, right? So there isn't anything to paint on the form - only ListView is painted.
You can easily check this by putting a breakpoint in forms OnPaint handler.
By the way, even if you didn't use client alignement, this method is quite flickery.

To overcome these problems, handle WM_WINDOWPOSCHANGING message for your form.
Like this:

type
  TForm1 = class(TForm)

  // .... your components ....

  private
    { Private declarations }
     procedure WMWinPosChange(var Msg: TWMWindowPosChanging); message WM_WINDOWPOSCHANGING;
  public


implementation

{$R *.DFM}

// .... your implementation code ....


procedure TForm1.WMWinPosChange(var Msg: TWMWindowPosChanging);
begin
   with Msg.Windowpos^ do
       if (flags and SWP_NOZORDER) = 0 Then hwndInsertAfter := HWND_BOTTOM;
   inherited;
end;

0
 

Author Comment

by:easysoft_studios
ID: 7181180
Thanks! It was the code I was looking for!
0
 
LVL 7

Expert Comment

by:Cynna
ID: 7181212
Thanks, but I'm curious about your grading criteria.
I mean, what should the A-grade answer for this question
contain, that is not in my answer?
Don't get me wrong, I'd just like to know what did I left out, so next time you get better answer, and I get better grade... :)

0
 

Author Comment

by:easysoft_studios
ID: 7181340
well, i've have before get critizied for giving too high grades, so I'm not so sure about giving grades.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 7

Expert Comment

by:Cynna
ID: 7181981
Too high grades? Well, your last 10 grades were B B C B B C C B C B
I wouldn't exactly call these too high-grades...

OK, let me give you my point of view on this subject.
There are several things you can do to iritate experts, thus reducing your
chances of getting a response. They all can be seen from your profile.

This is my top-4 list of no-no's:

1. Leave a trail of opened questions that have been answered. Abandoning
   your questions when you got a working solution is *the* way too have
   people ignoring you on your next one.

2. Slow response. If it takes you weeks to react to somebody's comment,
   chances are it will get treated as 1.

3. Unclear feedback. If you don't explain what exactly is the problem,
   experts are going to have a much harder time in trying to solve it.
   
4. Poor grades. You see, grade is irrelevant to you, but it is relevant
   to expert, because expert points = question points * grade.
   Here are, in my opinion, fair grading guides:

   - If answer fully provides you with solution, you should grade it A.

   - If it provides you with partial solution, but one that you can
     modify to suit you, it should get a B.

   - If it gives you only a clue, and you have to 'dig-in' on that clue
     to get to the solution, it's a C grade.
   
   Of course, grading issue is much too elaborate to fit in here, but,
   IMHO, these are the thumb-rules. If you try following them, I don't
   think you'll get critisied any more.

0
 

Author Comment

by:easysoft_studios
ID: 7182036
I get your point. But i think my problem have been, that i did'nt understod the system of EE. But ofcourse, i glad that someone tells me, so i'm (hopeful) get's better, of using EE and grading answers.
Thanks for explaining it to me, course I never knew all those things you wrote.
0
 
LVL 7

Expert Comment

by:Cynna
ID: 7182064
Oh, I see... well that explains it than.
You might surf a bit on different areas of EE. They
are on the right side of your main view, under "EE Community" title.
The quetion/answer subject is somewhat covered here:
http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp#14

BTW, if you have any questions of how the system works,
or are insure about something, just ask any expert that
you are currently coresponding with. If you have any more
questions on the subject right now, I'd be glad to try
answering them for you.
Also, at any time you might ask a 0-point question in Community support group, I think. That questions are
answered by the people who mantain this site, so you
can't get any more relevant answer that that.
You'll find all the basic rules in the online help of EE,
just click a bit... :)
0
 

Author Comment

by:easysoft_studios
ID: 7182282
i'll do that :)

thanks once again, it's allways nice to meet people who give time to help, guys like my self :)
0
 
LVL 7

Expert Comment

by:Cynna
ID: 7182392
No problem, glad to be of help.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

757 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

20 Experts available now in Live!

Get 1:1 Help Now