Drawing lines in a CListCtrl

Hi, I am using a CListCtrl in LVS_ICON mode to create a tree structure of my 
icons (which are the bones of a skinned mesh).  I have the icons all drawing 
OK, but would like to draw a red line to link a parent to a child and a blue 
line to link siblings.

I have tried various ways of getting the lines to draw, but cannot get the 
control to draw both the items and lines at the same time.  If I over-ride 
the WM_PAINT message in my CListCtrl derived class and draw the lines, I 
cannot see the items.

If instead I write a separate routine to draw the lines that is called by 
the dialog class, it draws the items but not the lines.

How can I have the control draw both?

I have also tried using UpdateWindow() and Update(nItem) in the control's 
OnPaint function without success.

Thanks!

0
TPFGuru (37)
3/1/2006 10:36:20 PM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
1471 Views

Similar Articles

[PageSpeed] 14

So, no one knows where I stick two drawing instructions:

MoveToEx(dc, Pos1.x, Pos1.y, NULL);
LineTo(dc, Pos2.x, Pos2.y);

for a CListCtrl so that it will correctly draw the items and the lines?

"TPFGuru" wrote:

> Hi, I am using a CListCtrl in LVS_ICON mode to create a tree structure of my 
> icons (which are the bones of a skinned mesh).  I have the icons all drawing 
> OK, but would like to draw a red line to link a parent to a child and a blue 
> line to link siblings.
> 
> I have tried various ways of getting the lines to draw, but cannot get the 
> control to draw both the items and lines at the same time.  If I over-ride 
> the WM_PAINT message in my CListCtrl derived class and draw the lines, I 
> cannot see the items.
> 
> If instead I write a separate routine to draw the lines that is called by 
> the dialog class, it draws the items but not the lines.
> 
> How can I have the control draw both?
> 
> I have also tried using UpdateWindow() and Update(nItem) in the control's 
> OnPaint function without success.
> 
> Thanks!
> 
0
TPFGuru (37)
3/2/2006 5:09:27 PM
I've never tried to do this, but if I were to try, I'd try either doing in 
it OnPaint() or making it an owner drawn control and do it in DrawItem().

Tom Archer's recent article might be interesting to you as well:

http://www.microsoft.com/indonesia/msdn/customdraw.aspx

Tom

"TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message 
news:A52FEB6F-4BBF-4576-AD28-337AF76C1580@microsoft.com...
> So, no one knows where I stick two drawing instructions:
>
> MoveToEx(dc, Pos1.x, Pos1.y, NULL);
> LineTo(dc, Pos2.x, Pos2.y);
>
> for a CListCtrl so that it will correctly draw the items and the lines?
>
> "TPFGuru" wrote:
>
>> Hi, I am using a CListCtrl in LVS_ICON mode to create a tree structure of 
>> my
>> icons (which are the bones of a skinned mesh).  I have the icons all 
>> drawing
>> OK, but would like to draw a red line to link a parent to a child and a 
>> blue
>> line to link siblings.
>>
>> I have tried various ways of getting the lines to draw, but cannot get 
>> the
>> control to draw both the items and lines at the same time.  If I 
>> over-ride
>> the WM_PAINT message in my CListCtrl derived class and draw the lines, I
>> cannot see the items.
>>
>> If instead I write a separate routine to draw the lines that is called by
>> the dialog class, it draws the items but not the lines.
>>
>> How can I have the control draw both?
>>
>> I have also tried using UpdateWindow() and Update(nItem) in the control's
>> OnPaint function without success.
>>
>> Thanks!
>> 


0
tserface (3860)
3/2/2006 5:22:36 PM
Thanks.  Everything I have seen so far involves changing the LVxxx property 
of a control item or doing a CListCtrl.Set....  command.  Trying to draw to 
the window with DC commands may not be possible.  I could always change it to 
a basic window and just draw it all manually.

Thanks.


"Tom Serface" wrote:

> I've never tried to do this, but if I were to try, I'd try either doing in 
> it OnPaint() or making it an owner drawn control and do it in DrawItem().
> 
> Tom Archer's recent article might be interesting to you as well:
> 
> http://www.microsoft.com/indonesia/msdn/customdraw.aspx
> 
> Tom
> 
> "TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message 
> news:A52FEB6F-4BBF-4576-AD28-337AF76C1580@microsoft.com...
> > So, no one knows where I stick two drawing instructions:
> >
> > MoveToEx(dc, Pos1.x, Pos1.y, NULL);
> > LineTo(dc, Pos2.x, Pos2.y);
> >
> > for a CListCtrl so that it will correctly draw the items and the lines?
> >
> > "TPFGuru" wrote:
> >
> >> Hi, I am using a CListCtrl in LVS_ICON mode to create a tree structure of 
> >> my
> >> icons (which are the bones of a skinned mesh).  I have the icons all 
> >> drawing
> >> OK, but would like to draw a red line to link a parent to a child and a 
> >> blue
> >> line to link siblings.
> >>
> >> I have tried various ways of getting the lines to draw, but cannot get 
> >> the
> >> control to draw both the items and lines at the same time.  If I 
> >> over-ride
> >> the WM_PAINT message in my CListCtrl derived class and draw the lines, I
> >> cannot see the items.
> >>
> >> If instead I write a separate routine to draw the lines that is called by
> >> the dialog class, it draws the items but not the lines.
> >>
> >> How can I have the control draw both?
> >>
> >> I have also tried using UpdateWindow() and Update(nItem) in the control's
> >> OnPaint function without success.
> >>
> >> Thanks!
> >> 
> 
> 
> 
0
TPFGuru (37)
3/2/2006 6:17:31 PM
> .... Trying to draw to
> the window with DC commands may not be possible.  I could always change it
to
> a basic window and just draw it all manually.

That's probably your best option.  I know that customizing CListCtrl and
CTreeCtrl is almost next to impossible.  The problem is that Microsoft has
not left any room for customization of these controls. Chances are whatever
you draw on the DC during the paint message will get wiped out by some
interal drawing of the control (like scrolling...)

AliR.

"TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message
news:CBBB98F6-0BE9-40B3-9FAB-326BA73B30D5@microsoft.com...
> Thanks.  Everything I have seen so far involves changing the LVxxx
property
> of a control item or doing a CListCtrl.Set....  command.  Trying to draw
to
> the window with DC commands may not be possible.  I could always change it
to
> a basic window and just draw it all manually.
>
> Thanks.
>
>
> "Tom Serface" wrote:
>
> > I've never tried to do this, but if I were to try, I'd try either doing
in
> > it OnPaint() or making it an owner drawn control and do it in
DrawItem().
> >
> > Tom Archer's recent article might be interesting to you as well:
> >
> > http://www.microsoft.com/indonesia/msdn/customdraw.aspx
> >
> > Tom
> >
> > "TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message
> > news:A52FEB6F-4BBF-4576-AD28-337AF76C1580@microsoft.com...
> > > So, no one knows where I stick two drawing instructions:
> > >
> > > MoveToEx(dc, Pos1.x, Pos1.y, NULL);
> > > LineTo(dc, Pos2.x, Pos2.y);
> > >
> > > for a CListCtrl so that it will correctly draw the items and the
lines?
> > >
> > > "TPFGuru" wrote:
> > >
> > >> Hi, I am using a CListCtrl in LVS_ICON mode to create a tree
structure of
> > >> my
> > >> icons (which are the bones of a skinned mesh).  I have the icons all
> > >> drawing
> > >> OK, but would like to draw a red line to link a parent to a child and
a
> > >> blue
> > >> line to link siblings.
> > >>
> > >> I have tried various ways of getting the lines to draw, but cannot
get
> > >> the
> > >> control to draw both the items and lines at the same time.  If I
> > >> over-ride
> > >> the WM_PAINT message in my CListCtrl derived class and draw the
lines, I
> > >> cannot see the items.
> > >>
> > >> If instead I write a separate routine to draw the lines that is
called by
> > >> the dialog class, it draws the items but not the lines.
> > >>
> > >> How can I have the control draw both?
> > >>
> > >> I have also tried using UpdateWindow() and Update(nItem) in the
control's
> > >> OnPaint function without success.
> > >>
> > >> Thanks!
> > >>
> >
> >
> >


0
AliR3470 (3235)
3/2/2006 8:10:46 PM
Thanks.  I figured as much.  I can see the lines after the WM_PAINT, but the 
items aren't drawn.

What do you recommend I use?  Maybe a big edit control, where I create and 
place buttons with Icons to behave like the CListCtrl items?  I am shooting 
for the kind of display that Maya 7 does for the HyperGraph, which seems to 
use buttons to represent the items, and you can drag a button onto another to 
set the relationship.  Could I detect when one button is dragged over another 
easily?

Thanks!

"AliR" wrote:

> > .... Trying to draw to
> > the window with DC commands may not be possible.  I could always change it
> to
> > a basic window and just draw it all manually.
> 
> That's probably your best option.  I know that customizing CListCtrl and
> CTreeCtrl is almost next to impossible.  The problem is that Microsoft has
> not left any room for customization of these controls. Chances are whatever
> you draw on the DC during the paint message will get wiped out by some
> interal drawing of the control (like scrolling...)
> 
> AliR.
> 
> "TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message
> news:CBBB98F6-0BE9-40B3-9FAB-326BA73B30D5@microsoft.com...
> > Thanks.  Everything I have seen so far involves changing the LVxxx
> property
> > of a control item or doing a CListCtrl.Set....  command.  Trying to draw
> to
> > the window with DC commands may not be possible.  I could always change it
> to
> > a basic window and just draw it all manually.
> >
> > Thanks.
> >
> >
> > "Tom Serface" wrote:
> >
> > > I've never tried to do this, but if I were to try, I'd try either doing
> in
> > > it OnPaint() or making it an owner drawn control and do it in
> DrawItem().
> > >
> > > Tom Archer's recent article might be interesting to you as well:
> > >
> > > http://www.microsoft.com/indonesia/msdn/customdraw.aspx
> > >
> > > Tom
> > >
> > > "TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message
> > > news:A52FEB6F-4BBF-4576-AD28-337AF76C1580@microsoft.com...
> > > > So, no one knows where I stick two drawing instructions:
> > > >
> > > > MoveToEx(dc, Pos1.x, Pos1.y, NULL);
> > > > LineTo(dc, Pos2.x, Pos2.y);
> > > >
> > > > for a CListCtrl so that it will correctly draw the items and the
> lines?
> > > >
> > > > "TPFGuru" wrote:
> > > >
> > > >> Hi, I am using a CListCtrl in LVS_ICON mode to create a tree
> structure of
> > > >> my
> > > >> icons (which are the bones of a skinned mesh).  I have the icons all
> > > >> drawing
> > > >> OK, but would like to draw a red line to link a parent to a child and
> a
> > > >> blue
> > > >> line to link siblings.
> > > >>
> > > >> I have tried various ways of getting the lines to draw, but cannot
> get
> > > >> the
> > > >> control to draw both the items and lines at the same time.  If I
> > > >> over-ride
> > > >> the WM_PAINT message in my CListCtrl derived class and draw the
> lines, I
> > > >> cannot see the items.
> > > >>
> > > >> If instead I write a separate routine to draw the lines that is
> called by
> > > >> the dialog class, it draws the items but not the lines.
> > > >>
> > > >> How can I have the control draw both?
> > > >>
> > > >> I have also tried using UpdateWindow() and Update(nItem) in the
> control's
> > > >> OnPaint function without success.
> > > >>
> > > >> Thanks!
> > > >>
> > >
> > >
> > >
> 
> 
> 
0
TPFGuru (37)
3/2/2006 8:26:27 PM
I would simply use a CWnd or CStatic as the container. You will run into the
same drawing problem with a CEdit.
As far as the items go, unless you need the functionality of a Button, I
would use a CWnd or CStatic, but a CButton should also be fine.
As far as drag and drop goes.  That can be a little tricky.  Typically drag
and drop is done using OLE (CDataSource, and CDropTarget), so what you will
have to do is detect the dragging in your item's class (CWnd or CButton...)
create the CDataSource and set its drag icon to be the same as the picture
of the item begin dragged.  You will also have to implement a CDropTarget
somewhere, either in each item, or at the parent level (the container
class), to get the drops.

With all that said, I would probably not do any of that.  I would use a CWnd
as the container window.

Then I would create a class for the items, the class would look something
like this
class CListItem
{
public:
    void Draw(CDC *pDC);
    BOOL HitTest(const CPoint &Pt);
private:
    CRect     m_Rect;
    CBitmap m_Image;
    .... any other info that is needed.
}

and use a CList or a link list to keep track of all the items that the
container owns, and draw them.
For drag and drop, handle the WM_LBUTTONDOWN, WM_LBUTTONUP, and
WM_MOUSEMOVE.  And do the drag and drop by detecting which item they clicked
on and dragged, and when the let the mouse button up, which object (if any)
the dropped it on.

I hope this helps.

AliR.



"TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message
news:9E620E31-8F82-4DF3-B6B0-B6AEB5C0EB36@microsoft.com...
> Thanks.  I figured as much.  I can see the lines after the WM_PAINT, but
the
> items aren't drawn.
>
> What do you recommend I use?  Maybe a big edit control, where I create and
> place buttons with Icons to behave like the CListCtrl items?  I am
shooting
> for the kind of display that Maya 7 does for the HyperGraph, which seems
to
> use buttons to represent the items, and you can drag a button onto another
to
> set the relationship.  Could I detect when one button is dragged over
another
> easily?
>
> Thanks!
>
> "AliR" wrote:
>
> > > .... Trying to draw to
> > > the window with DC commands may not be possible.  I could always
change it
> > to
> > > a basic window and just draw it all manually.
> >
> > That's probably your best option.  I know that customizing CListCtrl and
> > CTreeCtrl is almost next to impossible.  The problem is that Microsoft
has
> > not left any room for customization of these controls. Chances are
whatever
> > you draw on the DC during the paint message will get wiped out by some
> > interal drawing of the control (like scrolling...)
> >
> > AliR.
> >
> > "TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message
> > news:CBBB98F6-0BE9-40B3-9FAB-326BA73B30D5@microsoft.com...
> > > Thanks.  Everything I have seen so far involves changing the LVxxx
> > property
> > > of a control item or doing a CListCtrl.Set....  command.  Trying to
draw
> > to
> > > the window with DC commands may not be possible.  I could always
change it
> > to
> > > a basic window and just draw it all manually.
> > >
> > > Thanks.
> > >
> > >
> > > "Tom Serface" wrote:
> > >
> > > > I've never tried to do this, but if I were to try, I'd try either
doing
> > in
> > > > it OnPaint() or making it an owner drawn control and do it in
> > DrawItem().
> > > >
> > > > Tom Archer's recent article might be interesting to you as well:
> > > >
> > > > http://www.microsoft.com/indonesia/msdn/customdraw.aspx
> > > >
> > > > Tom
> > > >
> > > > "TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message
> > > > news:A52FEB6F-4BBF-4576-AD28-337AF76C1580@microsoft.com...
> > > > > So, no one knows where I stick two drawing instructions:
> > > > >
> > > > > MoveToEx(dc, Pos1.x, Pos1.y, NULL);
> > > > > LineTo(dc, Pos2.x, Pos2.y);
> > > > >
> > > > > for a CListCtrl so that it will correctly draw the items and the
> > lines?
> > > > >
> > > > > "TPFGuru" wrote:
> > > > >
> > > > >> Hi, I am using a CListCtrl in LVS_ICON mode to create a tree
> > structure of
> > > > >> my
> > > > >> icons (which are the bones of a skinned mesh).  I have the icons
all
> > > > >> drawing
> > > > >> OK, but would like to draw a red line to link a parent to a child
and
> > a
> > > > >> blue
> > > > >> line to link siblings.
> > > > >>
> > > > >> I have tried various ways of getting the lines to draw, but
cannot
> > get
> > > > >> the
> > > > >> control to draw both the items and lines at the same time.  If I
> > > > >> over-ride
> > > > >> the WM_PAINT message in my CListCtrl derived class and draw the
> > lines, I
> > > > >> cannot see the items.
> > > > >>
> > > > >> If instead I write a separate routine to draw the lines that is
> > called by
> > > > >> the dialog class, it draws the items but not the lines.
> > > > >>
> > > > >> How can I have the control draw both?
> > > > >>
> > > > >> I have also tried using UpdateWindow() and Update(nItem) in the
> > control's
> > > > >> OnPaint function without success.
> > > > >>
> > > > >> Thanks!
> > > > >>
> > > >
> > > >
> > > >
> >
> >
> >


0
AliR3470 (3235)
3/2/2006 9:16:26 PM
Thanks for the help!  Very good idea.


"AliR" wrote:

> I would simply use a CWnd or CStatic as the container. You will run into the
> same drawing problem with a CEdit.
> As far as the items go, unless you need the functionality of a Button, I
> would use a CWnd or CStatic, but a CButton should also be fine.
> As far as drag and drop goes.  That can be a little tricky.  Typically drag
> and drop is done using OLE (CDataSource, and CDropTarget), so what you will
> have to do is detect the dragging in your item's class (CWnd or CButton...)
> create the CDataSource and set its drag icon to be the same as the picture
> of the item begin dragged.  You will also have to implement a CDropTarget
> somewhere, either in each item, or at the parent level (the container
> class), to get the drops.
> 
> With all that said, I would probably not do any of that.  I would use a CWnd
> as the container window.
> 
> Then I would create a class for the items, the class would look something
> like this
> class CListItem
> {
> public:
>     void Draw(CDC *pDC);
>     BOOL HitTest(const CPoint &Pt);
> private:
>     CRect     m_Rect;
>     CBitmap m_Image;
>     .... any other info that is needed.
> }
> 
> and use a CList or a link list to keep track of all the items that the
> container owns, and draw them.
> For drag and drop, handle the WM_LBUTTONDOWN, WM_LBUTTONUP, and
> WM_MOUSEMOVE.  And do the drag and drop by detecting which item they clicked
> on and dragged, and when the let the mouse button up, which object (if any)
> the dropped it on.
> 
> I hope this helps.
> 
> AliR.
> 
> 
> 
> "TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message
> news:9E620E31-8F82-4DF3-B6B0-B6AEB5C0EB36@microsoft.com...
> > Thanks.  I figured as much.  I can see the lines after the WM_PAINT, but
> the
> > items aren't drawn.
> >
> > What do you recommend I use?  Maybe a big edit control, where I create and
> > place buttons with Icons to behave like the CListCtrl items?  I am
> shooting
> > for the kind of display that Maya 7 does for the HyperGraph, which seems
> to
> > use buttons to represent the items, and you can drag a button onto another
> to
> > set the relationship.  Could I detect when one button is dragged over
> another
> > easily?
> >
> > Thanks!
> >
> > "AliR" wrote:
> >
> > > > .... Trying to draw to
> > > > the window with DC commands may not be possible.  I could always
> change it
> > > to
> > > > a basic window and just draw it all manually.
> > >
> > > That's probably your best option.  I know that customizing CListCtrl and
> > > CTreeCtrl is almost next to impossible.  The problem is that Microsoft
> has
> > > not left any room for customization of these controls. Chances are
> whatever
> > > you draw on the DC during the paint message will get wiped out by some
> > > interal drawing of the control (like scrolling...)
> > >
> > > AliR.
> > >
> > > "TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message
> > > news:CBBB98F6-0BE9-40B3-9FAB-326BA73B30D5@microsoft.com...
> > > > Thanks.  Everything I have seen so far involves changing the LVxxx
> > > property
> > > > of a control item or doing a CListCtrl.Set....  command.  Trying to
> draw
> > > to
> > > > the window with DC commands may not be possible.  I could always
> change it
> > > to
> > > > a basic window and just draw it all manually.
> > > >
> > > > Thanks.
> > > >
> > > >
> > > > "Tom Serface" wrote:
> > > >
> > > > > I've never tried to do this, but if I were to try, I'd try either
> doing
> > > in
> > > > > it OnPaint() or making it an owner drawn control and do it in
> > > DrawItem().
> > > > >
> > > > > Tom Archer's recent article might be interesting to you as well:
> > > > >
> > > > > http://www.microsoft.com/indonesia/msdn/customdraw.aspx
> > > > >
> > > > > Tom
> > > > >
> > > > > "TPFGuru" <TPFGuru@discussions.microsoft.com> wrote in message
> > > > > news:A52FEB6F-4BBF-4576-AD28-337AF76C1580@microsoft.com...
> > > > > > So, no one knows where I stick two drawing instructions:
> > > > > >
> > > > > > MoveToEx(dc, Pos1.x, Pos1.y, NULL);
> > > > > > LineTo(dc, Pos2.x, Pos2.y);
> > > > > >
> > > > > > for a CListCtrl so that it will correctly draw the items and the
> > > lines?
> > > > > >
> > > > > > "TPFGuru" wrote:
> > > > > >
> > > > > >> Hi, I am using a CListCtrl in LVS_ICON mode to create a tree
> > > structure of
> > > > > >> my
> > > > > >> icons (which are the bones of a skinned mesh).  I have the icons
> all
> > > > > >> drawing
> > > > > >> OK, but would like to draw a red line to link a parent to a child
> and
> > > a
> > > > > >> blue
> > > > > >> line to link siblings.
> > > > > >>
> > > > > >> I have tried various ways of getting the lines to draw, but
> cannot
> > > get
> > > > > >> the
> > > > > >> control to draw both the items and lines at the same time.  If I
> > > > > >> over-ride
> > > > > >> the WM_PAINT message in my CListCtrl derived class and draw the
> > > lines, I
> > > > > >> cannot see the items.
> > > > > >>
> > > > > >> If instead I write a separate routine to draw the lines that is
> > > called by
> > > > > >> the dialog class, it draws the items but not the lines.
> > > > > >>
> > > > > >> How can I have the control draw both?
> > > > > >>
> > > > > >> I have also tried using UpdateWindow() and Update(nItem) in the
> > > control's
> > > > > >> OnPaint function without success.
> > > > > >>
> > > > > >> Thanks!
> > > > > >>
> > > > >
> > > > >
> > > > >
> > >
> > >
> > >
> 
> 
> 
0
TPFGuru (37)
3/2/2006 9:35:31 PM
Reply:

Similar Artilces:

Insert Lines
I have a worksheet sent to me with over 700 names on it. I need to put 4 extra lines under each name. Is there a way to do this without having to individually insert those lines as this will take a long time. Thanks. On Apr 29, 9:29=EF=BF=BDpm, RENEE <RE...@discussions.microsoft.com> wrote: > I have a worksheet sent to me with over 700 names on it. =EF=BF=BDI need = to put 4 > extra lines under each name. =EF=BF=BDIs there a way to do this without h= aving to > individually insert those lines as this will take a long time. =EF=BF=BDT= hanks. Output as CSV Open...

modify series data by changing chart lines?
I would like to change series data in a spreadsheet that has been line charted by manipulating the chart lines or trend-lines. Is that possible in Excel? Thanks for any help. ...

How do you add or subtract the subject line from the inbox / sent.
If you sign on to outlook and are in your inbox, you get a list of emails with name: subject: and date. How do you add or subtract the subject line? I have a friend who does not have the subject line and we can not figure out how to add it. Click your right mouse button over the grey column headings in the Inbox where the Subject heading is missing, select Field Chooser from the menu that appears and a box will appear containing all the mail fields, scroll down until you see Subject and then click and hold your left mouse button on the Subject field and drag it to where you want it in ...

a new drawing not erase previous drawing?
visual studio c++ 6.0, mfc, graphics in my program a new drawing erases previous drawing. How to manage that all that is drawn stays alive on the window? And is not erased when the window is covered by another window, as well. And that the image does not flicker... Those last two have from time to time appeared in my attempts to solve the first problem. And that I didn't manage at all - make the first drawing, then the second, see them both at the same time on the window. I have tried the following and maybe more: Invalidate(false), InvalidateRect(false), override OnEraseBkgnd, ...

how to draw a bitmap transparently?
Hi, I have an owner draw button associated with a bitmap. In the bitmap editor, I turn off the option "draw opaque" for the bitmap. That is, I make it transparent. However, the the bitmap's background color still shows up on the button. The bitmap has only a solid circle in the middle. What else do I have to do? Please help. Thanks. Tony One thing you can do--and this works only for some restricted cases, which you may or may not have--is to make the button background 192,192,192, and when you LoadImage, you specify LR_MAP3DCOLORS. It will change the 192,192,192 to...

owner draw CListBox, how to draw "no item found"
Hello, I have an owner draw listbox, in the DrawItem I draw the items. If the listbox doesn't contain any item I would like to display a message "no item found" but this is no item, so DrawItem is the wrong place. Where should I do this? OnPaint, OnEraseBkgnd? I thought I would be able to do something like this for a test (just paint the window blue) but it's always white BOOL CmyListbox::OnEraseBkgnd(CDC* pDC) { if (m_pItemList.GetCount() < 1) { CRect rc; GetClientRect(&rc); pDC->FillSolidRect(rc,RGB(0,0,255)); return TRU...

Secondary Axis Grid lines
Is there a way to show grid lines for a secondary y-axis? They've added this is 2007, which has so far only added to the confusion. It makes no sense to have two sets of Y axis gridlines, so set up the chart with the gridline-requiring data on the primary axis. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Arun" <Arun@discussions.microsoft.com> wrote in message news:0CBEB888-9705-4F56-94CA-84BCC6FD875C@microsoft.com... > Is there a way to show grid lines for a second...

Deleting Blank lines with VBA
Help I have a macro that runs multiple formulas. However, when the formulas are finished I am left with about 64000 blank lines. I am unable to insert a row on the worksheets as I get a Run-Time Error 1004 (Try to locate the last Nonblank Cell using CTRL-END). Here is a same of some of the formulas I am running ( the macro is very large). ActiveWorkbook.Names.Add Name:="TrunkFormulaI", RefersToR1C1:="=Trunks!R1C27" ActiveWorkbook.Names.Add Name:="TrunkFormulaJ", RefersToR1C1:="=Trunks!R1C28" ActiveWorkbook.Names.Add Name:="TrunkFormulaK&qu...

Line chart: Dates in uneven intervalls on x-achsis #2
'Supplementary' questions: Is there a clever way to make excel recogniz that '3 months' stands for '0.25 years', and '6 months' stands for '0. years'? I know, this is only cosmetics. Nevertheless it would be interesting ;) Gil -- gdavid ----------------------------------------------------------------------- gdavids's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1589 View this thread: http://www.excelforum.com/showthread.php?threadid=27378 You could use a helper column that divides months by 12 to scale as years. Jer...

Draw a horizontal line after the last record is printed on each pa
The details section of my report draws vertical lines which grow to accomodate text size changes. I would like to have a horizontal line drawn when last record finishes printing on the page and joins the end of the last vertical line to make a table. Please help. Thanks. -- Lydia Liu Access/VB Programmer There was at least one answer posted to your same question yesterday. -- Duane Hookom Microsoft Access MVP "Lydia" wrote: > The details section of my report draws vertical lines which grow to > accomodate text size changes. I would like to ha...

Anyone want to draw roads?
Just thought that if anyone wants to do diagrams with roads or rivers as double lines then Jeff Lanam (this n/group) kindly provided me with this link to a free programme called OCAD. Its a tiny file, is EASY to use and the results can be exported as a .bmp into Publisher. www.ocad.com I asked on this newsgroup how to achieve this and many threads resulted, so thought I'd post the solution. Many thanks Jeff (see reply to your post) Chrissss........ Glad you solved your map problem. An interesting program. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.o...

Indicate intersection point on a two-line graph
Hi, I have a simple line graph with two lines (line A and line B). They intersect at a given point (the break even point). How do I indicate on the graph that this is the break even point. I know its very easy to do with an arrow and text box. However, I would like the arrow and text box to move to a new intersection as I change the numbers around. Thanks, Greg Andy Pope has an example on his site which should help: http://www.andypope.info/charts/intersection.htm -- John Mansfield http://cellmatrix.net "Greg" wrote: > Hi, > > I have a simple line graph with...

Drawing graphs on Modal dialogs
I've encounter a strange phenomenon: I have an MFC application that creates a child dialog using DoModal(). Within this child dialog I have a couple of buttons and a graph plot drawn within the area of a Cstatic using a third party API from GraphicsServer. This modal dialog has a minimize button, but when I minimize the dialog, the graph doesn't minimize with the dialog is always on top of the screen. Has anyone encountered this problem? Do you think is is a GraphicsServer issue or a Microsoft issue? I've called Graphics Server and they say that they haven't countered my proble...

Where did the drawing go?
Visio 2003 SP2 with all the latest patches. I have an extensive floor plan created in a file. I renamed the page by double-clicking on the tab and replacing the name with 'Current'. I then added a page and called it 'Proposed'. The program hour-glassed for a bit which I thought was curious and then hung. I could close the program and since I did some editing on the file, I saved it when prompted. The next time I opened the file, the design was not visible and the scale was literally off the charts (it says X = - 46 ft., Y = 89478492 ft. 6, and if I go into Page Setup a...

Graph Line Width ?
Hello, Using Excel 2007. Dumb question, but I just can't seem to get it to work. Have a chart with a line graph. Guess it's called a Scatter Graph. Bunch of points, with lines connecting the points; the typical kind of thing. Looks fine, but I want to make the lines connecting all the data points "thinner". After clicking on the line graph (which I guess selects it) I right-click with the mouse and go to Format Data Points, but this doesn't seem to do anything for the entire line. How can I easily change the line width for the entire graph ? Thanks, Bob On Apr...

How to draw text always visible
Hi NG, I Have program which is drawing objects(PIPES)using the OPENGL. The labels for the for the PIPE is drawing using the GDI. The text colour for the labels is same that of the objects. The labels are usually positioned at out side of the pipe so that it will be visible always. But while rotating there are possibilities that the labels and objects coincide. I want to set the labels always visible with respect to the back ground colour. I used SetRop2() but it has no effect. Any help would be greatly appreciated Best regards Raghuram.k ...

double line format button only formats single line when added to .
When adding a double line format button to my Toolbar using the Customize, Categories Box, Command Box and then dragging the double line format button to my Toolbar, I only get a single line format when using this button. It's a bug. There's a workaround in the following thread. http://groups.google.com/groups?threadm=3C59F286.DB7C606A%40msn.com AlwaysLearning wrote: > When adding a double line format button to my Toolbar using the Customize, > Categories Box, Command Box and then dragging the double line format button > to my Toolbar, I only get a single line format wh...

2003 documents converted to 2007, lines drawn in are misaligned
I have 100s of documents converted over to 2007 and anywhere there were lines drawn in from the "shapes" menu - they are not lining up properly on the page when printed out. ...

Data which is over 65536 lines long
Can anyone help? I am trying to open a file using Microsoft Excel. However, when I try to open it, as it contains data which is more than 65536 lines long, it will not open properly showing all the data. Is there anyway to show all the data? Is there a way to format the spreadsheets beforehand so when you open the file, anything over 65536 lines will automatically continue onto the next sheet? I would be grateful if anyone can help. Thank you. Hi KI See this kb http://support.microsoft.com/default.aspx?scid=kb;en-us;120596 -- Regards Ron de Bruin http://www.rondebruin.nl "KI&q...

One Register with Line Display Not Working
Hi all ~ I've got a problem with one register's line display. It's a Posiplex 7000. I've got two of them, one works and the other doesn't. I was able to get the line display to work last week, except for the minor problem with the line wrapping from above. Now the text is messed up - it looks like the Matrix code. Actually, it looks like the font like the Matrix code (from the movie) or like ascii. I tried restarting the pc, unplugging the display and I re-tried the driver from Posiflex. It looks like it's a problem within POS, because if I switch to another app...

Owner draw main windows, will left some drawing on the background of the window, I want the reason and how to prevent this happen? 01-05-10
Hi, Everyone! Ownerdraw main window , I used SetWindowRgn to cut down the four corners, but there will left something drawing here when you drag the corners and borders to resized the window on the background of the main window. Only 3 corners of the four corners do this. I used HDC hWindowDC = GetWindowDC(); Draw the non client area on hWindowDC In class of WTL: class CMainFrame : public CFrameWindowImpl<CMainFrame>, public CUpdateUI<CMainFrame>, public CMessageFilter, public CIdleHandler Thanks a lot! Have a Happy New Year! begin 666 problem.JPG ...

Secondary value in a LINE Chart
I've been trying to create a dual value line chart without success. I'd specifically want to have data for both the primary and secondary value Y axises as LINES not DOTS. Is someone able to help me out with this or am I facing a bug? I'm using 2000 btw. Thanks! Create a line chart from your data Select a series that you want on the secondary axis Choose Format>Selected Data Series On the Axis tab, select Secondary Click OK Lauri wrote: > I've been trying to create a dual value line chart without > success. I'd specifically want to have data for both the ...

Can Excel graph a line from an equation? y=3x+2
Can Excel do linear programming problems? I'm wondering if Excel can graph from an equation rather than data points and can it identify points of intersection? Hi, Have a look at Stephen Bullen's ChtFrmla example. http://www.oaltd.co.uk/Excel/SBXLPage.asp#Charting To calculate intersection you will probably need to create all the points in cells in order to use formula, which sort of negates the need for the non cell based approach Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "GraphLady" <GraphLady@discussions.microsoft.com> wrote ...

How Draw a chart showing the following function: y=sin(x)
Can someone explain me how can i make this chart i excel? Remember i don't want use function to count! I want draw! Thanks for hel -- Pusie ----------------------------------------------------------------------- PusieK's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1621 View this thread: http://www.excelforum.com/showthread.php?threadid=27630 For a variety of approaches adapt the ideas at Normal curve http://www.tushar-mehta.com/excel/charts/normal_distribution/index.htm particularly the three sections: Enumerating a set of points in a worksheet Using...

how to print grid lines in bold in excel 2000
is there a way to have the grid lines print in bold using excel 2000? jaykay Wrote: > is there a way to have the grid lines print in bold using excel 2000? Hi jaykay Add borders to the cells you want bold gridlines, Format > Cells Border Tab, you can select the thickness of the lines using the Lin Style bo -- Paul Sheppar ----------------------------------------------------------------------- Paul Sheppard's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2478 View this thread: http://www.excelforum.com/showthread.php?threadid=39695 no, but you can F...