English 中文(简体)
转口方言时不会再停下来的症状中的习俗控制
原标题:Custom control under modaldialog not repainting when moving dialog
  • 时间:2011-01-07 15:47:06
  •  标签:
  • c#
  • .net
  • gdi+

是什么原因? 其它控制显示是罚款......

    public CustomControl()
    {
        SetStyle(ControlStyles.ResizeRedraw, true);
        SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
        SetStyle(ControlStyles.UserPaint, true);
    }

习俗控制在表LayoutPanel。

......

Edit: For clarification: Suppose you have a window-sized control with a small modal dialog form on top. When you move the dialog window, it s like your painting with the window on the control (the borders are painted on the control). The control doesn t repaint itself like other controls do on the same form, ie montcalendar or other custom controls. I can t seem to find the cause of this ?

参考书目:

“alt

最佳回答

Hard to tell from the snippet. The standard mistake is to draw through Control.CreateGraphics() instead of the OnPaint() method. Won t work, Windows lets the OnPaint method run when parts of the control get uncovered. Which wipes out whatever you drew. Another failure mode is deriving from a control that s a wrapper for a native Window control. UserPaint is not supported for these type of controls, the native Windows code has to do the drawing.


从屏幕上可以清楚看出,该文本是如何被夸大的。 这是因为“OnPaint()”凌驾于此。 ClipRectangle property to amount out where tofer. 当你慢慢地把窗户拖到你控制的地方时,这种价值总是会发生变化,这只是告诉你,控制的一部分需要重新撤出。 页: 1 请参看,。 这必须基于控制束缚,通常从(0,0)到(ClientSize.Width、客户Size.H8)。

只使用过了。 优化提纲。 如同在拖拉机车外收集昂贵的图谱一样。 否则,视窗就是一个小小小块,在自动剪辑时已经相当好。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

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 ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签