Solved

Painting on a TPageControl Background

Posted on 1998-06-08
6
354 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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