excel表格上如何打五角星
五角星大概做不到,至少2003版的不可,能换的形状只有这几种,楼主要是2007版的大概会有此外形状。
2.怎么操作excel vba编程在窗体上画五角星参考:Option Explicit Private lTriangle As FormShape Private lEllipse1 As FormShape Private lEllipse2 As FormShape Private lEllipse3 As FormShape Private lEllipse4 As FormShape Private lEllipse5 As FormShape Private lRectangle As FormShape Private Sub UserForm_Layout()'destroy any preexisting shapes.Call DestroyShapes'add the Shapes to the form.lTriangle = AddShape(Me, Triangle, Me.Width / 2, 0, 120, 80, &HFFFF00, "Click Me") lEllipse1 = AddShape(Me, Ellipse, 10, 10, 120, 40, vbMagenta, "Click Me") lEllipse2 = AddShape(Me, Ellipse, 50, 60, 60, 60, vbYellow, "Click Me") lEllipse3 = AddShape(Me, Ellipse, 160, 100, 40, 40, &HFF&) lEllipse4 = AddShape(Me, Ellipse, 200, 100, 30, 30, &H8080FF) lEllipse5 = AddShape(Me, Ellipse, 230, 100, 20, 20, &HC0C0FF) lRectangle = AddShape(Me, Rectangle, 10, 100, 60, 60, , "Click Me") End Sub Private Sub UserForm_Click() Dim tpt As POINTAPI GetCursorPos tpt ScreenToClient lFormHwnd, tpt'handle the shapes click events.Select Case (lFormHwnd, tpt.x, tpt.y) Case lTriangle.hwnd If GetPixel(lFormDC, tpt.x, tpt.y) = lTriangle.Fill Then MsgBox "You clicked Triangle1" End If Case lEllipse1.hwnd If GetPixel(lFormDC, tpt.x, tpt.y) = lEllipse1.Fill Then MsgBox "You clicked Ellipse1." End If Case lEllipse2.hwnd If GetPixel(lFormDC, tpt.x, tpt.y) = lEllipse2.Fill Then MsgBox "You clicked Ellipse2." End If Case lRectangle.hwnd MsgBox "You clicked Rectangle1" End Select End Sub Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)'remove the form subclass.Call UnSubClassForm(True) End Sub Private Sub DestroyShapes() DestroyWindow lTriangle.hwnd DestroyWindow lEllipse1.hwnd DestroyWindow lEllipse2.hwnd DestroyWindow lEllipse3.hwnd DestroyWindow lEllipse4.hwnd DestroyWindow lEllipse5.hwnd DestroyWindow lRectangle.hwnd End Sub Private Sub CommandButton1_Click() Unload Me End Sub。
,抖客教程网