border surrounding an owner-drawn listbox

Looking for some direction on the proper method to implement the
following.  I have an owner-drawn listbox that I would like to also
draw a RoundRect surrounding the listbox.

Simply getting the windowrect, inflating it, and then drawing the
roundrect doesn't do it because it gets clipped.

I tried (or at least I think I did) to increase the clipping rect, draw
it, and then restore, but that didn't pan out.

Of course, the entire time, I doing this for each item being draw,
which seems a waste.

Hence the question here.... :)

Thanks,
-Vin

0
8/24/2005 11:38:25 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
1111 Views

Similar Articles

[PageSpeed] 43

Hallo develop!

> Looking for some direction on the proper method to implement the
> following.  I have an owner-drawn listbox that I would like to also
> draw a RoundRect surrounding the listbox.
> 
> Simply getting the windowrect, inflating it, and then drawing the
> roundrect doesn't do it because it gets clipped.

Just try to get a DC from the Parent and paint with this DC.
Its no good style in my eyes, because the window will not know to redraw 
this area when it gets invalidated.
IMHO it is not possible for you to change the client rect in the way 
that the list box is drawn in some offset so you can include your frame 
in the client area.

Maybe it is better to create a outer window that draws the border and 
that itself contains the listbox.

-- 
Martin Richter [MVP] WWJD
"In C we had to code our own bugs. In C++ we can inherit them."
FAQ : http://www.mpdvc.de
Samples: http://www.codeguru.com http://www.codeproject.com
0
8/24/2005 1:06:23 PM
Hello Martin!

So, would it make more sense then to include the roundrect drawing
inside the listbox area and draw the actual listbox a little smaller in
width and height?  It then should redraw itself when invalidated?

Thanks,
-Vin



Martin Richter [MVP] wrote:
> Hallo develop!
>
> > Looking for some direction on the proper method to implement the
> > following.  I have an owner-drawn listbox that I would like to also
> > draw a RoundRect surrounding the listbox.
> >
> > Simply getting the windowrect, inflating it, and then drawing the
> > roundrect doesn't do it because it gets clipped.
>
> Just try to get a DC from the Parent and paint with this DC.
> Its no good style in my eyes, because the window will not know to redraw
> this area when it gets invalidated.
> IMHO it is not possible for you to change the client rect in the way
> that the list box is drawn in some offset so you can include your frame
> in the client area.
>
> Maybe it is better to create a outer window that draws the border and
> that itself contains the listbox.
>
> --
> Martin Richter [MVP] WWJD
> "In C we had to code our own bugs. In C++ we can inherit them."
> FAQ : http://www.mpdvc.de
> Samples: http://www.codeguru.com http://www.codeproject.com

0
8/24/2005 1:47:26 PM
The easiest way is to create a new WS_POPUP window and put your listbox 
inside it as a WS_CHILD.  Your new popup window can paint the roundrect, and 
your listbox is unaffected.

Anytime you want to adorn a standard Windows control like a listbox with 
things outside it's client area, it's best to create a new parent for it. 
Mucking with the listbox client by resizing, getting the same DC, setting 
clipping, etc. has never worked very well for me.

-- David


"develop" <develop@iesoft.com> wrote in message 
news:1124883505.181637.149460@g47g2000cwa.googlegroups.com...
> Looking for some direction on the proper method to implement the
> following.  I have an owner-drawn listbox that I would like to also
> draw a RoundRect surrounding the listbox.
>
> Simply getting the windowrect, inflating it, and then drawing the
> roundrect doesn't do it because it gets clipped.
>
> I tried (or at least I think I did) to increase the clipping rect, draw
> it, and then restore, but that didn't pan out.
>
> Of course, the entire time, I doing this for each item being draw,
> which seems a waste.
>
> Hence the question here.... :)
>
> Thanks,
> -Vin
> 


0
dc2983 (3206)
8/24/2005 2:28:38 PM
There are a number of problems.

First, you can't do this by drawing the client rectangle; you need to get a window
rectangle.

But I discovered that doing SetWindowRgn is *not* honored by the kernel when it comes to a
listbox! I can change the shape of a button using SetWindowRgn, but a listbox appears to
ignore this (although I discovered by doing FrameRgn that the region is actually there!)

Increasing the clipping rectangle will do no good, because it applies only to the client
area, and you can't draw outside the client area.  You could respond to a WM_NCPAINT
request, but it will only let you draw on the window area, which is only a couple pixels
larger than the client area.

Here's the code I used to create the effect I think you want...

This was done for an owner-draw-fixed, LBS_HASSTRINGS listbox.  Feel free to modify the
parts necessary for your project

// RoundedList.cpp : implementation file
//

#include "stdafx.h"
#include "RoundedList.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CRoundedList

CRoundedList::CRoundedList()
{
}

CRoundedList::~CRoundedList()
{
}


BEGIN_MESSAGE_MAP(CRoundedList, CListBox)
        //{{AFX_MSG_MAP(CRoundedList)
        //}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRoundedList message handlers
#define CURVE 30

void CRoundedList::PreSubclassWindow() 
{
        CRect r;

        GetClientRect(&r);

        CRgn rgn;

        rgn.CreateRoundRectRgn(r.left, r.top,
                               r.right, r.bottom, 
            CURVE,
            CURVE);

        SetWindowRgn((HRGN)rgn, TRUE);
        rgn.Detach();
        Invalidate();
        CListBox::PreSubclassWindow();
}


void CRoundedList::DrawItem(LPDRAWITEMSTRUCT dis) 
   {
    CDC * dc = CDC::FromHandle(dis->hDC);
    // Make a copy of the bounding rectangle so we can modify it if we desire

    int save = dc->SaveDC();

    CRect r = dis->rcItem;

    CRgn rgn;
    rgn.CreateRectRgn(0,0,1,1); // create dummy region
    GetWindowRgn((HRGN)rgn);


    dc->SelectClipRgn(&rgn);

    // Handle the case where the control is empty. Draw an empty focus rectangle to
indicate the control has focus
    if(dis->itemID == (UINT)-1)
       { /* empty list */
        if(dis->itemState & ODS_FOCUS)
           dc->DrawFocusRect(&r);
       } /* empty list */

    else
       { /* something to show */
        // Determine the text color and background color
        COLORREF bgcolor;
        COLORREF txcolor;

        if(dis->itemState & ODS_SELECTED) 
           { /* selected */
            if(::GetFocus() == m_hWnd)
               { /* control has focus */
                bgcolor = ::GetSysColor(COLOR_HIGHLIGHT);
                txcolor = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
               } /* control has focus */
            else
               { /* other control has focus */
                bgcolor = ::GetSysColor(COLOR_BTNFACE); 
                txcolor = ::GetSysColor(COLOR_WINDOWTEXT);
               } /* other control has focus */
           } /* selected */
        else
           { /* unselected */
            bgcolor = ::GetSysColor(COLOR_WINDOW);
            txcolor = ::GetSysColor(COLOR_WINDOWTEXT);
           } /* unselected */

        dc->FillSolidRect(&r, bgcolor);
        // Compute a width of the color box

        dc->SetBkMode(TRANSPARENT);
        CString s;
        GetText(dis->itemID, s);
        dc->SetTextColor(txcolor);
        dc->SetBkMode(TRANSPARENT);
        dc->TextOut(r.left + CURVE / 2, r.top, s);
        if(dis->itemState & ODS_FOCUS)
           dc->DrawFocusRect(&r);

       } /* something to show */

    // Restore the DC to its original state
    // The destructors of the selected objects
    // will now correctly delete the GDI objects
    dc->RestoreDC(save);

    // Now draw the border and set the unused color area to COLOR_3DFACE
    save = dc->SaveDC();

    CBrush br(::GetSysColor(COLOR_WINDOWFRAME));
    dc->FrameRgn(&rgn, &br, ::GetSystemMetrics(SM_CXBORDER),   
                                                        ::GetSystemMetrics(SM_CYBORDER));
    CRect c;
    GetClientRect(&c);
    CRgn rgnw;
    rgnw.CreateRectRgn(c.left, c.top, c.right, c.bottom);
    CRgn rgndiff;
    rgndiff.CreateRectRgn(0,0,1,1);
    rgndiff.CombineRgn(&rgnw, &rgn, RGN_DIFF);
    dc->SelectClipRgn(&rgndiff);
    dc->FillSolidRect(&c, ::GetSysColor(COLOR_3DFACE));
    dc->RestoreDC(save);
   }



On 24 Aug 2005 04:38:25 -0700, "develop" <develop@iesoft.com> wrote:

>Looking for some direction on the proper method to implement the
>following.  I have an owner-drawn listbox that I would like to also
>draw a RoundRect surrounding the listbox.
>
>Simply getting the windowrect, inflating it, and then drawing the
>roundrect doesn't do it because it gets clipped.
>
>I tried (or at least I think I did) to increase the clipping rect, draw
>it, and then restore, but that didn't pan out.
>
>Of course, the entire time, I doing this for each item being draw,
>which seems a waste.
>
>Hence the question here.... :)
>
>Thanks,
>-Vin
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
8/25/2005 2:50:45 AM
Hi Joe,

Thanks for the information.

Your solution is what I thought after failing in other possibilities.
Basically, using the listbox area and slightly decreasing it to make
the roundrect work.

Now onto making the roundrect antialiased, which is another challenge!

Thanks,
-Vin

Joseph M. Newcomer wrote:
> There are a number of problems.
>
> First, you can't do this by drawing the client rectangle; you need to get a window
> rectangle.
>
> But I discovered that doing SetWindowRgn is *not* honored by the kernel when it comes to a
> listbox! I can change the shape of a button using SetWindowRgn, but a listbox appears to
> ignore this (although I discovered by doing FrameRgn that the region is actually there!)
>
> Increasing the clipping rectangle will do no good, because it applies only to the client
> area, and you can't draw outside the client area.  You could respond to a WM_NCPAINT
> request, but it will only let you draw on the window area, which is only a couple pixels
> larger than the client area.
>
> Here's the code I used to create the effect I think you want...
>
> This was done for an owner-draw-fixed, LBS_HASSTRINGS listbox.  Feel free to modify the
> parts necessary for your project
>
> // RoundedList.cpp : implementation file
> //
>
> #include "stdafx.h"
> #include "RoundedList.h"
>
> #ifdef _DEBUG
> #define new DEBUG_NEW
> #undef THIS_FILE
> static char THIS_FILE[] = __FILE__;
> #endif
>
> /////////////////////////////////////////////////////////////////////////////
> // CRoundedList
>
> CRoundedList::CRoundedList()
> {
> }
>
> CRoundedList::~CRoundedList()
> {
> }
>
>
> BEGIN_MESSAGE_MAP(CRoundedList, CListBox)
>         //{{AFX_MSG_MAP(CRoundedList)
>         //}}AFX_MSG_MAP
> END_MESSAGE_MAP()
>
> /////////////////////////////////////////////////////////////////////////////
> // CRoundedList message handlers
> #define CURVE 30
>
> void CRoundedList::PreSubclassWindow()
> {
>         CRect r;
>
>         GetClientRect(&r);
>
>         CRgn rgn;
>
>         rgn.CreateRoundRectRgn(r.left, r.top,
>                                r.right, r.bottom,
>             CURVE,
>             CURVE);
>
>         SetWindowRgn((HRGN)rgn, TRUE);
>         rgn.Detach();
>         Invalidate();
>         CListBox::PreSubclassWindow();
> }
>
>
> void CRoundedList::DrawItem(LPDRAWITEMSTRUCT dis)
>    {
>     CDC * dc = CDC::FromHandle(dis->hDC);
>     // Make a copy of the bounding rectangle so we can modify it if we desire
>
>     int save = dc->SaveDC();
>
>     CRect r = dis->rcItem;
>
>     CRgn rgn;
>     rgn.CreateRectRgn(0,0,1,1); // create dummy region
>     GetWindowRgn((HRGN)rgn);
>
>
>     dc->SelectClipRgn(&rgn);
>
>     // Handle the case where the control is empty. Draw an empty focus rectangle to
> indicate the control has focus
>     if(dis->itemID == (UINT)-1)
>        { /* empty list */
>         if(dis->itemState & ODS_FOCUS)
>            dc->DrawFocusRect(&r);
>        } /* empty list */
>
>     else
>        { /* something to show */
>         // Determine the text color and background color
>         COLORREF bgcolor;
>         COLORREF txcolor;
>
>         if(dis->itemState & ODS_SELECTED)
>            { /* selected */
>             if(::GetFocus() == m_hWnd)
>                { /* control has focus */
>                 bgcolor = ::GetSysColor(COLOR_HIGHLIGHT);
>                 txcolor = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
>                } /* control has focus */
>             else
>                { /* other control has focus */
>                 bgcolor = ::GetSysColor(COLOR_BTNFACE);
>                 txcolor = ::GetSysColor(COLOR_WINDOWTEXT);
>                } /* other control has focus */
>            } /* selected */
>         else
>            { /* unselected */
>             bgcolor = ::GetSysColor(COLOR_WINDOW);
>             txcolor = ::GetSysColor(COLOR_WINDOWTEXT);
>            } /* unselected */
>
>         dc->FillSolidRect(&r, bgcolor);
>         // Compute a width of the color box
>
>         dc->SetBkMode(TRANSPARENT);
>         CString s;
>         GetText(dis->itemID, s);
>         dc->SetTextColor(txcolor);
>         dc->SetBkMode(TRANSPARENT);
>         dc->TextOut(r.left + CURVE / 2, r.top, s);
>         if(dis->itemState & ODS_FOCUS)
>            dc->DrawFocusRect(&r);
>
>        } /* something to show */
>
>     // Restore the DC to its original state
>     // The destructors of the selected objects
>     // will now correctly delete the GDI objects
>     dc->RestoreDC(save);
>
>     // Now draw the border and set the unused color area to COLOR_3DFACE
>     save = dc->SaveDC();
>
>     CBrush br(::GetSysColor(COLOR_WINDOWFRAME));
>     dc->FrameRgn(&rgn, &br, ::GetSystemMetrics(SM_CXBORDER),
>                                                         ::GetSystemMetrics(SM_CYBORDER));
>     CRect c;
>     GetClientRect(&c);
>     CRgn rgnw;
>     rgnw.CreateRectRgn(c.left, c.top, c.right, c.bottom);
>     CRgn rgndiff;
>     rgndiff.CreateRectRgn(0,0,1,1);
>     rgndiff.CombineRgn(&rgnw, &rgn, RGN_DIFF);
>     dc->SelectClipRgn(&rgndiff);
>     dc->FillSolidRect(&c, ::GetSysColor(COLOR_3DFACE));
>     dc->RestoreDC(save);
>    }
>
>
>
> On 24 Aug 2005 04:38:25 -0700, "develop" <develop@iesoft.com> wrote:
>
> >Looking for some direction on the proper method to implement the
> >following.  I have an owner-drawn listbox that I would like to also
> >draw a RoundRect surrounding the listbox.
> >
> >Simply getting the windowrect, inflating it, and then drawing the
> >roundrect doesn't do it because it gets clipped.
> >
> >I tried (or at least I think I did) to increase the clipping rect, draw
> >it, and then restore, but that didn't pan out.
> >
> >Of course, the entire time, I doing this for each item being draw,
> >which seems a waste.
> >
> >Hence the question here.... :)
> >
> >Thanks,
> >-Vin
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm

0
8/26/2005 11:27:56 AM
Reply:

Similar Artilces:

Custom Border Art
When I try to use a 19KB .GIF image as custom border art, I get an error message, "The image is too complex to be made into a border" message. The image has 4 colors and would appear to my eye to be less complex than some of those images already in the clipart file. Suggestions? How can I "simplify" the image. I use Photoshop. Thanks After managing to set up OE-QuoteFix on his new PC, Ed reads a message from Peter <anonymous@discussions.microsoft.com>... > When I try to use a 19KB .GIF image as custom border art, I get an > error message, "The image i...

How to "press" the listbox vertical scrollbar programmatically
Hi all... I have a CListBox derived class. When some condition occures in the CListBox' parent object, I need to simulate the click on the scrollbar. That simulation includes the visual effect of button pression, besides, of course, the actual scroll of the listbox. I have tried sending WM_SETCURSOR and WM_NCLBUTTONDOWN messages to the listbox but without success. Any help will be greatly appreciated. Thanks Jaime ...

listbox click event question
I am using Excel 2003. I have a two userforms, one with a listbox and one with a commandbutton. The click event of the listbox on userform1 hides the userform1 and shows userform2. The commandbutton on userform2 unloads userform2 and shows userform 1. It works exactly as I want it for the first click of the listbox; however, after the commandbutton on userform2 is clicedk to close userform2 and show userform1, the click event on the listbox does not fire. This is initiating code Sub test() UserForm1.Show End Sub This is the code for the listbox Private Sub ListBo...

Listbox NOT in cell
I have a row of cells (row 2) that is aligned vertical and is narrow. I want to have a listbox for data dropdown but because you have to check "In cell dropdown" the list is unreadable because I only see 2 characters. Unchecking the box doens't give me a dropdown icon. Is there a work-around so I can see the whole list? Thanks to all who reply. -- Ray Tweedale All-around-nice-guy ...

Border
How do I get a page border? please e-mail me at DougRossOnER@aol.com is you know the answer. I would greatly appreciate it! Thanks a lot! We don't do e-mail for bone lazy coots like you. You ignorant cucaracha need to learn some manners and decorum. You don't even have enough common sense to post the version of Publisher you are using. You must also have to low an intellect to use a HELP file. -- The US should free all those illegally held prisoners they are torturing, abusing and denying human rights being held at Guantanamo Bay. ���MS�Publisher��� wrote: > We don't do...

Default Gridlines/Cell Border Colors
By default the gridlines on a worksheet and any borders that you put around cells are the same color - black. If you change the gridline colors using Tools - Options - View all the cell borders that you have created also change color. Is this a way to change the color of the gridlines in a worksheet and keep the default color for cell borders black? >>Is this a way to change the color of the gridlines in a worksheet and keep >>the default color for cell borders black? I don't believe so. The automatic color for borders is whatever the color for gridlines is, unless...

Borders
Hi I need to do a border with rounded corners. Is this possible with Publisher 2002 and if so how? Thanks Andy After managing to set up OE-QuoteFix on his new PC, Ed reads a message from Oshiponga <andy_hodson{nospam}@hotmail.com>... > I need to do a border with rounded corners. Is this possible with > Publisher 2002 and if so how? You can use a Rounded Rectangle AutoShape, or if it's BorderArt you're after, you can check the Clip Organiser and the Design Gallery Online -- Ed Bennett - MVP Microsoft Publisher http://www.mvps.org/the_nerd/ Before reading this mess...

Distribution List Permission Denied to Owner
Running XP Pro on the desktop and Exchange 2003/Server 2000 in the back office with Powerfuse for desktop management. I am having trouble with giving ownership of public distribution lists to users on our standard imaged machines. Users on those machines are denied permssion to make changes to groups. However, the same user on a non-imaged machine (no PowerFuse, either) do not get this error message. Any ideas? t. This will happen if Exchange refers Outlook to a GC outside of clients own domain. Search for "closest gc" or "ClosestGC" keywords and implement a GPO...

Listbox ?
Is it possible to prevent a user from selecting any item in a listbox? I'm using a listbox to display the values of several cells. I just want the user to be able to scroll through the list box and read what is there but not select anything. is this possible? Thanks for the help. -- JT You can set the enabled property to False, if the list box is from the control toolbox. However, if the user is Excel xavvy, they can change it back to true. Maybe a textbox or a label would have been a better choice. "JT" <JT@discussions.microsoft.com> wrote in ...

After hiding unused columns to the right, border on right disappea
(Excel 2003) I created a form and only wanted to show the form itself, not the unused columns and rows. I selected column J - control-end - column-hide. The vertical border on the right side disappeared. The only way I was able to get it to show was to unhide column J - which I'd prefer not to have showing. I also tried drawing a rule, but wasn't able to line it up perfectly. Any suggestions? ...

Listbox questions
If I add like 20 items to my userform's listbox control, how can I determine if a user selects or double clicks on item 10?? I'm just trying to figure out which event handles when an item is selected or double clicked. Thank you Assuming your listbox is ListBox1, if you use: Private Sub ListBox1_Click() MsgBox "You Selected" & Me.ListBox1.Value End Sub The above code would display a message box that tells you what selection you made, if the ListBox1 is not a multiselect type. "Robert Crandal" <nobody@gmail.com> wrote in messag...

listbox double click which item
I want to know which item in a listbox was double clicked on. This works but doesn't seem like i should have to do it this way Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean) Dim index As Integer With ListBox1 For index = 0 To .ListCount - 1 If .Selected(index) Then MsgBox index End If Next End With End Sub thanks for any tips mark What you are looking for is the ListIndex... Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean) Dim Ndex As Long Ndex = ListBox1.ListIndex MsgBox Ndex End Sub Also, don...

Formatting a footer with a top border-line
I am using Excel 2002, but this seems to be a problem for me with Word 2002 as well. I want to format my footer with a top border (i.e., there should be a border-line just over the footer and between it and the rest of the page. I seem to remember being able to do this. With Word, I can format the footer with a box around it, but that looks awful. I just want a nice descrete line over the footer to separate it from the body of the page. Clicking the Text Format Tool while in headers/footers only formats the font, its size, underline/bold/italics, etc. No border lines are available as ...

How to show objects in a ListBox depedent of their state??
Hi, In my Documentclass is a list of Objects. This objectlist I want t display in a ListBox that sits on a CFormView, which is connected t the document class. Secondly it is necessary, that the ListBoxentrie are diplayed according to the status of the actual object. For exampl one ListBox-Entry shall be green and the other one shall be red.... I derived my own ListBox-Class and overwrote the drawItem()- an measureItem()-method, but I think, in these methods I should get acces to the actual object to be displayed....How can I do this??? I mean, filled the List with "m_ListBox.AddString...

Cell Border Width
Is there a way in Excel to increase the width of a border? I have lots of text that I am managing in Excel, and when I print it out, the cells tend to run together a little bit - is there any way to increase the amount of white space between rows and columns - without adding a thin empty column between the columns (and a thin empty row between the rows). I you experimented with making the columns wider and the rows deeper? best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email <mark.wolven@gmail.com> wrote in message news:df49d9bb-...

Multicolumn listbox behaving wwird in VC7.1
Prob: Created a Listbox with Horizontal Scroll and Multicolumn property set to true. When you select any item in the columns say XCol other than the first column, the item in the XCol+1 column in the same row would be selected if XCol+1 exists else it would select the last item in the list. To be simple if you select 2 rwo item in the 2 Column, the 2 row element in the 3 column would be selected if 3column exists else it will select the last item in the list. It happens only when you select other than the first column for the first tim in the list. For subsequent selections it works fin...

Bug?--Excel 2003 Bottom Double Border tool not working
I just installed Excel 2003 (part of Small Business Edition of Office). I have checked for program updates. As I have with prior versions of Excel, I added the Bottom Double Border (BDB) tool (not to be confused with the Double Underline or Borders tool icons) to my toolbar. When I highlight one or more cells and click the BDB tool, I only get a single line bottom border. To get a double underline, I have to use the Borders tool or Format Cells/Borders. Anyone know a fix for the BDB tool (other than creating a macro that does create the double border and assigning it to a too...

Change Owner on New Account SetUp
Hello, I have an employee that will be setting up new clients for our sales team. She will be creating these accounts and then selecting the appropriate owner for the account. Right now the spyglass next to the owner field in accounts is greyed out. How do I get that working to allow her to select any of the users? Thanks, CHristina There are two possibilities and without access to a system at the moment I cannot confirm which. Firstly ensure the user has permissions to assign accounts Then if the option is still greyed out, it may be that it has to be done using the assign function. T...

Why does my bottom double border button not work?
I customized my tool bar to include a button that will put two underlines in the bottom of a cell. It seemed to work for a couple of day, but now when I click on it, it only places a single line at the bottom of the cell. If I go in an manually format the cell for a dual line, the button on the tool bar is highlighted. If anyone knows what is causing this I would appreciate a solution. Jeff It's a bug. Some people report that it was fixed by installing service packs, others (like me) still have the problem. Here's a thread that suggests a workaround. http://groups.google.c...

selected item in listbox turn red instead of black
How can I make the back color of the selected item in a listbox turn red instead of black when clicked? Thanks -- deb Is there a shorter version. That is a bit of overkill for what I need. I just want the selected item to turn red instead of black. Not each row a different color. Any other suggestions -- deb "Wayne-I-M" wrote: > Hi Deb > > Check the link > > http://www.lebans.com/listboxenhanced.htm > > Good luck > > -- > Wayne > Manchester, England. > > > > "deb" wrote: > > > > > How can ...

How do I delete a border that is not showing up in the preview?
I am in Publisher and the page I am creating has a border in it that I didn't put in the publication. This border doesn't show up when I hit print preview but prints on paper. How do I get rid of it? Thin line is displayed and printed around the object when you apply a combination of a border and a fill to the object in Publisher http://support.microsoft.com/default.aspx?scid=kb;en-us;290911 -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Stephanie Smith" <Stephanie Smith@discussions.microsoft.com> wrote i...

Cell border formatting problem
Hi - In a simple, unprotected worksheet (Excel 2002), I cannot format the borders of some of the cells. If I click on the border button on the formatting toolbar, nothing happens. If I go to Format>Cells on the Menu Bar, nothing happens. I can, however, type in these cells. For some of these cells, I can copy and paste a formatted cell from another part of the worksheet successfully. For some cells, I cannot copy and paste a formatted cell. Sometimes if I select a range of cells around the offending cell, I can format all of them. But I still cannot format the offender by itself. ...

Cell borders not printing
I'm running Excel X. The thinnest available cell border won't print. I've tried two different printers. The thicker borders will print but look less than appealing on screen. Has anyone else come across this problem? I've seen it - it may depend on which printer driver you're using. In the print dialog, be sure to set the target printer to the one you're printing to, rather than the generic printer. You might also check the manufacturer's site to see if there's an update to your drivers. In article <8ec801c3ea7c$9df884e0$a101280a@phx.gbl>, "rDe...

Vertical tab control with owner draw enabled
Hi I have a tab control with owner draw enabled in which I am drawing a icon and a text. It works perfectly fine when the TCS_VERTICAL option is not selected. But when I select TCS_VERTICAL option I am not able to see the text. Could anyone knows a solution for this? Regards ...

Left border of chart from Excel doesn't print
When I print a chart from Excel, the left border does not print. Printer is HP T45 Officejet. Elizabeth - Is the chart on its own sheet, or is it embedded as an object on another sheet? In Print Preview does the border appear? The usual advice is to make sure the printer driver is up to date. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Elizabeth wrote: > When I print a chart from Excel, the left border does not print. Printer is > HP T45 Officejet. ...