English 中文(简体)
用于 Tab 控件的 WM_ PAINT 事件也需要手工绘制项目吗?
原标题:deal WM_PAINT event for Tab Control also need to draw the items manually?

我创建了一个制表器控件, 并在它上创建了多个制表项。 我希望我的制表符控件( 没有项目的区域) 背景有良好的外观 。 所以我使用 gradientFinll 来绘制制表器控件 。 但是, 这样做时, 标签项就消失了 。 这与父子窗口的情况不同 。 因此, 如果我想更改制表符控件的背景, 我是否应该也绘制制表项?

这是代码:

switch(message) {
    case WM_PAINT:
        HDC hdc;
        PAINTSTRUCT ps;
        RECT rectTabControl;

        hdc = BeginPaint(hwnd, &ps);

        GetClientRect(hwnd, &rectTabControl);

        TRIVERTEX        vert[2] ;
        GRADIENT_RECT    gRect;

        vert [0] .x      = 0;
        vert [0] .y      = 0;
        vert [0] .Red    = 0x1000;
        vert [0] .Green  = 0x0000;
        vert [0] .Blue   = 0x0000;
        vert [0] .Alpha  = 0x0000;

        vert [1] .x      = rectTabControl.right;
        vert [1] .y      = rectTabControl.bottom; 
        vert [1] .Red    = 0xff00;
        vert [1] .Green  = 0x0000;
        vert [1] .Blue   = 0x0000;
        vert [1] .Alpha  = 0x0000;

        gRect.UpperLeft  = 0;
        gRect.LowerRight = 1;

        GradientFill(hdc,vert,2,&gRect,1,GRADIENT_FILL_RECT_H);

        EndPaint(hwnd, &ps);
        return 0;
}
最佳回答

“所以,如果我想更改制表器控制的背景,我是否也应绘制制表项目?”

问题回答

暂无回答




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签