Solved

Changing Forms Cursor

Posted on 1997-06-28
2
187 Views
Last Modified: 2010-04-04
I am having problems with cursor in Deplhi.

I have a TQuery Component. I change the SQL statement property programaticaly in this control. Before I change the SQL statement I first close the query and when the new SELECT statement is formed I open the query to show the new
data.

Before closing the query I change cursor to hourglass and change it to default after opening the query. Here I have problems because, cursor changes to default before opening the query. The cursor changes only when I first open the query. Then it doesn't change any more. It is like the lines for changing cursor are ignored. The cursor stays default.
0
Comment
Question by:marko020397
[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
2 Comments
 
LVL 1

Accepted Solution

by:
sleach earned 100 total points
ID: 1337936
Try placing:

Application.processmessages;

immediately after the line of code that changes the cursor.

That should force any pending messages to be processed.
Hope this does the trick ;)


0
 
LVL 4

Author Comment

by:marko020397
ID: 1337937
I have tried it but it didn't help.

I have solved the problem just after I sent the question.
I used forms variable Cursor like this

Cursor := crHourGlass;

Then I tried Screens variable Cursor and now it works just fine:

Screen.Cursor := crHourGlass;
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

738 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