[VB 2008]旋转控件 [英] [VB 2008] Rotate a control
问题描述
您好,
我已经创建了适当的控件并且我会旋转它。
在我的对象的绘画事件中,我写道:
昏暗图形As Graphics = myObject.CreateGraphics
myMatrix = New System.Drawing.Drawing2D.Matrix
myMatrix.Rotate(45,System。 Drawing.Drawing2D.MatrixOrder.Append)
graph.Transform = myMatrix
但它不起作用。
我创建的对象(房子的2D墙)没有旋转。
如果有人说如何解决它。
谢谢。
" vino" < al ******* @ discuss.microsoft.comschrieb:
我已经创建了适当的控件,我会旋转它。
在我的对象的paint事件中,我写道:
Dim graph As Graphics = myObject.CreateGraphics
myMatrix = New System.Drawing .Drawing2D.Matrix
myMatrix.Rotate(45,System.Drawing.Drawing2D.MatrixOrder.Append)
graph.Transform = myMatrix
但是它不起作用。
我创建的对象(房子的2D墙)没有旋转。
你必须在你正在使用的''Graphics''对象上设置转换
绘制内容,通常在'' OnPaint''或''Paint''事件处理程序。
-
MS Herfried K. Wagner
MVP< ; URL:http://dotnet.mvps.org/>
VB< URL:http://dotnet.mvps.org/dotnet/faqs/>
谢谢Herfried K. Wagner的回答。
但我知道怎么做。
旋转值由用户设置,他可以随时更改它,而且我的个人组件必须立即轮换。
谢谢。
6月17日,11:49 * am,vino< alex_v ... @ discuss.microsoft.comwrote:
谢谢Herfried K. Wagner的回答。
但是我知道怎么做。
旋转值由用户和他可以随时更改它我的个人组件必须立即轮换。
谢谢。
BTW,您要旋转的对象是什么类型的?工具箱中的一种标准
控制?
谢谢,
OnurGüzel
Hello,
I have created my proper control and i would to rotate it.
In the paint event of my object, i have written :
Dim graph As Graphics = myObject.CreateGraphics
myMatrix = New System.Drawing.Drawing2D.Matrix
myMatrix.Rotate(45, System.Drawing.Drawing2D.MatrixOrder.Append)
graph.Transform = myMatrix
but it don''t work.
The object i have created (a 2D wall of a house) no rotate.
If someone say how to resolve it.
Thanks.
"vino" <al*******@discussions.microsoft.comschrieb:I have created my proper control and i would to rotate it.
In the paint event of my object, i have written :
Dim graph As Graphics = myObject.CreateGraphics
myMatrix = New System.Drawing.Drawing2D.Matrix
myMatrix.Rotate(45, System.Drawing.Drawing2D.MatrixOrder.Append)
graph.Transform = myMatrix
but it don''t work.
The object i have created (a 2D wall of a house) no rotate.You have to set the transformation on the ''Graphics'' object you are using to
draw the content, typically in ''OnPaint'' or the ''Paint'' event handler.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Thank you Herfried K. Wagner for your answer.
But i have any idea how to do it.
The rotation value is set by the user and he can change it whenever and my
personal component has to rotate immediately.
Thanks.
On Jun 17, 11:49*am, vino <alex_v...@discussions.microsoft.comwrote:Thank you Herfried K. Wagner for your answer.
But i have any idea how to do it.
The rotation value is set by the user and he can change it whenever and my
personal component has to rotate immediately.
Thanks.BTW, what type is your object to be rotated? A kind of standard
control in toolbox?
Thanks,
Onur Güzel
这篇关于[VB 2008]旋转控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!