本文介绍了C#中VB6的OLE_COLOR,集合和StdPicture?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能将VB6的OLE_COLOR,Collection和StdPicture类型转换为C#吗?它们在C#中是什么?谢谢.

I cant convert OLE_COLOR, Collection and StdPicture type of VB6 to C#? What are they in C#? Thanks.

推荐答案

//OLE color
// Create an instance of a Color structure.
Color myColor = Color.Red;

// Translate myColor to an OLE color.
int oleColor = ColorTranslator.ToOle(myColor);

// Translate oleColor to a GDI+ Color structure.
Color myColorAgain = ColorTranslator.FromOle(oleColor);

/*-------------------------------------------------------*/
//Collection 
System.Collection.ObjectModel.Collection<T>

/*Ref : http://msdn.microsoft.com/en-us/library/ms132397(v=vs.90).aspx */

/*-------------------------------------------------------*/
//StdPicture
IntPtr iconHandle = (IntPtr)GetHandleFromYourCOMMethod(); // assuming the COM(VB6) method returns StdPicture
Icon myIcon = Icon.FromHandle(icnoHandle);


/*-------------------------------------------------------*/
//FormWindowStateConstants
VB              .Net(C#)
vbNormal    (0)	System.Windows.Forms.FormWindowState.Normal
vbMinimized (1)	System.Windows.Forms.FormWindowState.Minimized
vbMaximized (2)	System.Windows.Forms.FormWindowState.Maximized

/* Ref: http://msdn.microsoft.com/en-us/library/system.windows.forms.formwindowstate.aspx */


这篇关于C#中VB6的OLE_COLOR,集合和StdPicture?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 18:11