Background image or transparency in ListBox

Hi.
I'm looking for some ListBox derived class that give me en opportunity to
make my ListBox transparent (I have a background on my dialog and want to
make only text visible and selectable on my ListBox) or set some background
image to ListBox so the only text will be visible (with no white rectangle
on background).
Do you now something like that? Of course first of all I tried google to
help me, but search gave me useless results.
Thanks.

--

German Koninin

---------------------------------------------------------------------
For every complex problem, there's solution that is simple, neat and
wrong...


0
German
11/24/2003 4:01:37 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
755 Views

Similar Articles

[PageSpeed] 6

"German" <german.koninin@crm-worldwideDOTnet> wrote in message
news:e%23IuDSqsDHA.2520@TK2MSFTNGP10.phx.gbl...
> Hi.
> I'm looking for some ListBox derived class that give me en opportunity to
> make my ListBox transparent (I have a background on my dialog and want to
> make only text visible and selectable on my ListBox) or set some
background
> image to ListBox so the only text will be visible (with no white rectangle
> on background).
> Do you now something like that? Of course first of all I tried google to
> help me, but search gave me useless results.

The simplest way to get a window that is transparent is to not paint its
background.  You could try implementing a do nothing WM_ERASEBKGND handler.
I haven't tried this but it seems obvious to me.  The only problem I can see
would be if there are any controls that paint some of their "structural"
components when erasing the background, i.e. borders, headings, buttons,
etc.  FWIW, I doubt that there are (m)any controls that paint their layount
when doing an erase background.  If you want to do something like alpha
blending (semi-transparency) you'll have to research it but for small
windows it can obviously be done in a WM_ERASEBKGND handler by simply
averaging the control background and the dialog beneath the control.  You
may need to force the parent to re-paint (with a clip rectangle) when doing
an erase background to avoid problems with text removed from a list not
erasing when removed (due to you not really painting the packground).  IIRC,
there is a transparent extended window style but some of the reading I've
been doing suggests it may not be supported by controls.  If it is and you
can use CreateWindowEx then you might avoind that problem by simply
indicating that the window is transparent and let window send paint messages
in the correct order to achieve your goal.


0
mairdanot (111)
11/24/2003 4:39:28 PM
This is not right.
I know that the easiest way is to overwrite OnEraseBkgnd function, but this
is not working in ListBox.
that's why I ask my question here.

"David A. Mair" <mairdanot@hotrmail.com> wrote in message
news:eazVJmqsDHA.3416@tk2msftngp13.phx.gbl...
> "German" <german.koninin@crm-worldwideDOTnet> wrote in message
> news:e%23IuDSqsDHA.2520@TK2MSFTNGP10.phx.gbl...
> > Hi.
> > I'm looking for some ListBox derived class that give me en opportunity
to
> > make my ListBox transparent (I have a background on my dialog and want
to
> > make only text visible and selectable on my ListBox) or set some
> background
> > image to ListBox so the only text will be visible (with no white
rectangle
> > on background).
> > Do you now something like that? Of course first of all I tried google to
> > help me, but search gave me useless results.
>
> The simplest way to get a window that is transparent is to not paint its
> background.  You could try implementing a do nothing WM_ERASEBKGND
handler.
> I haven't tried this but it seems obvious to me.  The only problem I can
see
> would be if there are any controls that paint some of their "structural"
> components when erasing the background, i.e. borders, headings, buttons,
> etc.  FWIW, I doubt that there are (m)any controls that paint their
layount
> when doing an erase background.  If you want to do something like alpha
> blending (semi-transparency) you'll have to research it but for small
> windows it can obviously be done in a WM_ERASEBKGND handler by simply
> averaging the control background and the dialog beneath the control.  You
> may need to force the parent to re-paint (with a clip rectangle) when
doing
> an erase background to avoid problems with text removed from a list not
> erasing when removed (due to you not really painting the packground).
IIRC,
> there is a transparent extended window style but some of the reading I've
> been doing suggests it may not be supported by controls.  If it is and you
> can use CreateWindowEx then you might avoind that problem by simply
> indicating that the window is transparent and let window send paint
messages
> in the correct order to achieve your goal.
>
>


0
German
11/25/2003 9:37:08 AM
Reply:

Similar Artilces:

Help!!How to make background of an image to be transparently in report?
I put an image named Image1 in a report and change Image1.picture in background VBA code. Image1.picture="c:\a.gif" a.gif is a picture with transparently background .But in print view of the report,it's background turns white! Why? And How to make background of an image to be transparently in report? Try http://www.lebans.com/transparent.htm This works on white opaque bacgrounds. I've used it in A2003 but cannot get it to work for A2007. Strangely form brought forward from A2003 to A2007 are OK. Rod I do not have A2007 installed here but I would imagine t...

PPTools Optimizer and Transparent PNGs?
Does the PPTools Optimizer compress a transparent png picture and still leave a transparent back? I see it do a transparent gif, but it fills the back of a png. Am I doing anything wrong or is it not made to deal with png's like that? Thanks, Mel In article <c931399d-da3f-4c2b-9745- 5003416cf7ba@j31g2000yqa.googlegroups.com>, Mel wrote: > Does the PPTools Optimizer compress a transparent png picture and > still leave a transparent back? I see it do a transparent gif, but it > fills the back of a png. Am I doing anything wrong or is it not made > to deal with...

Automatically Resizing Listboxes
I've written an option pricing model that is constantly updating valuations in real-time based on a datafeed. Because of this, I leave the sheet on autorecalc. On a few of the sheets in the workbook, I have listboxes allowing me to select the tenor of the series I'm trying to price. Occasionally excel goes into a 'death spiral' and begins to resize these boxes automatically until they are almost non-existent and then crashes. The problem is not consistent - many times I can close and reopen excel and the problem is solved. I figure there must be a conflict somewhere, but I...

How to Set/Change Transparency to CEdit control?
Hi, How to set/change Transparency to Custom Edit control. Can I use SetLayeredWindowAttributes() to set alpha factor for CEdit control? Can I use WS_EX_LAYERED style to child (CEdit) controls? Or should I use GDI+ library feature (Gdiplus::SolidBrush(Gdiplus::Color()). At present both ways are not working for me. Since the edit control is drawn with GDI, invoking a GDI+ mechanism is not going to be terribly successful. While you might consider subclassing the edit control and returning a NULL_BRUSH, this will not produce satisfactory results because edit controls are drawn with SetBkMode(OP...

Image Writer
I was advised to use Image Writer as a default versatile printer in Publisher to create PostScript files and PDFs. Image Writer is supposed to be available under Add Printers/Generic, but the only Generic printer on my system is "Generic / Text Only." Can something be downloaded from somewhere? Jim, What version Publisher? Look on the Publisher disk. I simply don't know why it isn't on your computer. I've had it on my computer since time began so I assumed it was a Windows thing, after looking around I have concluded it is a Publisher driver. -- Mary Sauer MS M...

Background color #2
I am creating a sheet where VBA creates new cells, I need to color the cell background, I just cannot seem to find anything that looks remotely like a fill or background function. I have been trying in the area of Range("A1"). Help would be very much appreciated. Thanks. Range("A1").Interior.ColorIndex = 6 will produce the yellow background color in A1 "Dave Griffiths" <dave@daveg.co.uk.nospam> wrote in message news:oPpUb.1899$rj4.27730@news2.e.nsc.no... > I am creating a sheet where VBA creates new cells, I need to color the > cell backgrou...

Linking Cells across sheets to be mirror images
Hey all=). I'm not sure my title makes sense, so let me go into further detail. Lets say you have a large report of data, in which you copy lines out of to a new sheet, in the same workbook. So now you can work on this single item, without all the other info, but instead of having to go back to the main sheet once I am finished and find that line again, is there a way, to link the cells, so that whatever you type into your new cells, will update the cells of origin? ...

Using ListView background as Generic Graphic File viewer?
On another forum, a user posted a message to the effect he could use a listview control, with or without frame, and set the background to a graphic file to get a view of the file (which could be one of multiple common graphic file types) Is anyone familiar with this technique and could they give an example of the purported 5 or 6 lines it would take to implement? Thanks. Rufus I found what is likely the solution, but it says it uses OLE COM libraries. Basically I put this call in OnInitDialog(): CoInitialize(NULL); and when I wanted to read the file and display it: char strGraphFi...

Set Height Property of image control
I've tried to set the image height of an image control in the OnOpen code: Me.ctlImage.Height = 1.193 * Me.ctlImage.Width such that it will conform to the aspect ratio of images to be displayed. The assignment statement didn't have any affect. With a debug stop after the statement, neither the height or width show any value. What do I need to do here to set the Height property of the image control? Thanks, Bill I see I need to do two things. One is that the width needs to be obtained with the ImageWidth property. And two, that I need to deal with these quantities being in twi...

Sorting ListBox
Hi I need to control sorting in a CListBox control. I fount that to do this, I have to make it Owner Draw. So I did override the following methods, virtual int CompareItem( LPCOMPAREITEMSTRUCT lpCIS ); virtual void DrawItem(LPDRAWITEMSTRUCT lpDIS); virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMIS); I create it with m_list.Create(LBS_OWNERDRAWFIXED|LBS_SORT|LBS_HASSTRINGS|LBS_NOTIFY|LBS_NOIN TEGRALHEIGHT|WS_HSCROLL|WS_VSCROLL|WS_CHILD|WS_VISIBLE,CRect(0,0,100,100),th is,100); But, in this case the CompareItem doesn't get called. I gets called if I don't use LBS_HASSTRINGS style...

Can I fill a cell with a transparent color?
Can I fill a cell with a transparent color? Hi Tom, Could you elaborate a little please? Your text will render regardlesas of what the fill color is, provided it isn't the same color. If you mean you want to set the transparency, well, I don't think that's possible unless you cover a cell with a text box from Drawing. You can adjust the transparency of those. Cheers, Jon "RP" wrote: > Can I fill a cell with a transparent color? ...

ListBox/ComboBox creation/deletion using VBA.
I wish to offer users the facility to select data from a list that is populated using the results of a search facility - a ListBox or a ComboBox is the solution of choice. I know how to use VBA to populate the list and to determine the response and process accordingly. I have already done this with pre-existing boxes that have been created on a spreadsheet. But, search as I may, I cannot find out how to Create and Delete list/combo boxes using VBA. Can sks please point me in the right direction. TIA Chris ...

Images and thumbnails questions
Hello-- I am running XP Pro, with Access 2007. I have several folders, each with hundreds of image files-- most of these are photo .tifs. I would like to make a database that contains the file names and key information about each file (date it was taken, what it is a picture of, etc.). I want this database to be searchable by users, who will be prompted to enter criteria for specific attributes ("The photo(s) you are looking and from what year(s)? _____________"); users must be able to answer in plain language-- the users cannot be required to enter any code or any...

Gradient Transparency in Publisher 2003
I'm new at Publisher 2003 and am wondering if I'm doing something wrong. After creating my page of text and graphics I decided I wanted a gradient in the background of the page. I drew a box, filled it with a gradient, and moved it the the back of the document layers. When I printed it, the gradient looked too dark. I went into the "fill" settings for the box and adjusted the transparency for the gradient to make it look "softer" on the page. Now the transparency looks great in Publisher, but when I print it I get the same dark gradient as before. It acts like...

How can I scan images into seperate worksheets at once?
I am trying to use my scanner to insert documents into excel. When I do it, it adds all the images into one sheet that overlap each other. How can I get excel to add each image to its own worksheet? jwewing23 wrote: > I am trying to use my scanner to insert documents into excel. When I do it, > it adds all the images into one sheet that overlap each other. How can I get > excel to add each image to its own worksheet? What I do is scan into a file, then run that file through OCR software and then that data goes into Excel. But then I want data I can manipulate with Excel -- I&...

Transparent Command Button & DBPix controls
Hi everybody, When I'm placing a command button over an image control and set the Trasparent property to "Yes", I can e.g. click the image (button) and let the click_event do it's work. Why doesn't this work with a DBPix control? It looks like it is impossible to place the Command Button on top. Do I do something wrong here? Or is there another solution for the problem here at hand? Thanks you all. The way Access forms are implemented prevents ActiveX Controls from being placed behind the built-in Access controls. You could place an ActiveX button on-top of s...

Transparency in Fill Effects greyed out
Hi, I'm creating an area chart from 2 series of data on Office XP. The area charts overlap each other. Therefore, in order to allow area-chart behind to show through, i would like to set some kind of transparency on the area-chart laying on top. However, the fill effects | gradient | transparency feature is disabled. Any suggestions appreciated. Microsoft put the Transparency on that dialog to make you wish you were using a Mac. Transparency chart fills are not possible to create in Windows Excel, although you can view the effect in Windows if it was produced that way on a Mac. - J...

Images in reports that change with each record
I am building a database of the inventory in a store. My database is working splendidly but then the manager's said to add a thumbnail of all the items to their corresponding record. I thought that by simply adding an ole object field would do the trick but apparently when I look at the report and print it; the images don't appear, only their pathname. I need the pictures to be visible and that I can print the report with the images showing. Please help! hey people I really need help with this one. "Disorganized Rusty Officemeister" wrote: > I am building a databas...

Transparent Text Box Over Another
I am trying to place a semi-transparent text box over a document. The problem is that the text in the underlying boxes moves around the new box rather than staying fixed where they are. How can I fix this? Thanks, Cindy I'm curious - what do you mean by "semi-transparent"? Do you mean something like a watermark? -- JoAnn Paules - MVP Microsoft Publisher "Cindy" <anonymous@discussions.microsoft.com> wrote in message news:42f201c42b90$6cf88d90$a401280a@phx.gbl... > I am trying to place a semi-transparent text box over a > document. The problem is that...

Images display incorrectly as preview
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I'm experiencing a frustrating problem with images in MS Word. My colleague sends me Word documents images produced in Kaleidagraph that I think are .tiff or .png. On my screen, the image box size is correct, but the image itself appears as a tiny preview-sized low-resolution reproduction in the upper-left corner of the box. The same thing happens if I try to print or save as a PDF. If I right-click the image, Word refers to it as an &quot;unknown object&quot;. <br> I have no trouble with imag...

how can I change the rain drop background to plain in Visio? Tha.
how can I change the rain drop background to plain in Visio? Tha... Drag n drop the "Background none" master onto your page "Nelson" <Nelson@discussions.microsoft.com> wrote in message news:DC6C27D7-73FF-47AF-AF0B-5E2E8317ABAF@microsoft.com... > how can I change the rain drop background to plain in Visio? Tha... ...

Listbox returning numeric value not string
I have a multiselect listbox that lists all users in my MDW file. After making selections and submitting my form, the values that were selected are not the text strings displayed in the lisbox, but rather numeric values. How do I return the text string? If you have multiple columns in your list box, you can return the correct value by identifying the column you want. If the text is in say column 2, you would use Me.MyListBox(1) Column numbers for a list box start at 0. -- Dave Hargis, Microsoft Access MVP "Scott Whetsell, A.S. - WVSP" wrote: > I have a multiselect l...

Image not getting loaded from My.Resources
i got code below which works fine but i cant see image which is in My.Resources in webbrowser. Please can any friend help Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim imge imge = My.Resources.Smile Me.WebBrowser1.Navigate("about:<html><marquee scrolldelay=130> Hello World<body leftmargin='0' rightmargin='0' topmargin='5' bottommargin='0'><img src ='imge' height=20 width=20></img></body></ marquee></html>&q...

VPC Image of RMS
Is there a VPC Image for RMS? ...

Images from file into datagridview
Hi, I really appreciate all the help I'm getting from this group. I'm loading a datagridview and I need to add thumbnails to it based on a string that's returned from the database. So first I load the data, then I create and add a datagridviewimagecolumn. The reason I'm adding a column to show the photo is that the rest of the grid is bound but the images aren't stored in the database. They're stored on file. Then based on a string column returned to the datagrid I loop through my newly created image column creating a bitmap for each row. I think cre...