Solved

Painting on a TPageControl Background

Posted on 1998-06-08
6
326 Views
Last Modified: 2010-04-04
I want to be able to paint an image onto the blank panel of a TPageControl, so that a wallpaper will show if no tabbed sheets are present, in a similar way to trapping the WM_ERASEBACKGROUND message and painting on the MDI parent.

The page control doesn't seem to have any properties or methods that will permit this.

Ross McMillan
0
Comment
Question by:rossmcm
  • 4
  • 2
6 Comments
 
LVL 1

Accepted Solution

by:
michaue earned 100 total points
ID: 1351510
Put a TImage control on the TPageControl with a image in the Picture property and then just make the TImage visible or invisible as you need it to be shown.
0
 

Author Comment

by:rossmcm
ID: 1351511
Doesn't work for me.  Sure, you can place an image on a tab sheet of the page control, but you can't place an image on the page control.  My app starts up with an empty page control and this is where I want the BMP to display.  When a tabbed page is added at run-time the BMP should then be obscured.  If the tabbed page is removed the BMP should then reappear.
0
 
LVL 1

Expert Comment

by:michaue
ID: 1351512
Why don't you just put the TImage underneath the TPageControl with the same size.  When no tabbed pages is active you can make the TPageControl.Visible := False and then show the TImage.  Give the users a button or something to add the first page eg.

Hope it works.

PS You can even put the TImage on a TPanel to give the same effect as the TPageControl
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 1

Expert Comment

by:michaue
ID: 1351513
Well, did it work that way....

Hope it did, because there's always a way around any programming bug!


0
 

Author Comment

by:rossmcm
ID: 1351514
OK, that works, but you still need to check PageCount and assign to the Visible property every time the tab sheets might have been added or removed.  


0
 
LVL 1

Expert Comment

by:michaue
ID: 1351515
Well that's every programmer I know's problem ...  But that's life.  ;-\

Hope the rest of your system works OK.

Have Fun.  Elfrieda :-}
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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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