典型用法是为 CStatic::SetBitmap 提供一个 GDI 对象,该对象由 CBitmap 或CImage 对象的 HBITMAP 运算符返回。 执行此操作的代码类似于以下行。复制 MyStaticControl.SetBitmap(HBITMAP(MyBitmap)); 以下示例在堆上创建两个 CStatic 对象。 然后它使用 CBitmap::LoadOEMBitmap 加载带有系统位图的对象,...
CStatic::Create创建 Windows 静态控件并将其附加到CStatic对象。 CStatic::DrawItem通过替代的方式绘制所有者绘制的静态控件。 CStatic::GetBitmap检索先前使用SetBitmap设置的位图句柄。 CStatic::GetCursor检索先前使用SetCursor设置的光标图像的句柄。 CStatic::GetEnhMetaFile检索先前使用SetEnhMetaFile设置的增强型元文件...
CStatic *pStatic=(CStatic*)GetDlgItem(IDC_STATIC); pStatic->SetWindowText("Just a Test of Static Control!"); 二。CStatic 用于显示图标 如果要显示图标,则必须要设置窗口属性为 SS_ICON 和 SS_CENTERIMAGE,实例代码如下: CStatic* pStatic = (CStatic*)GetDlgItem(IDC_STATIC); LONG style = GetWindowLong...
CStatic类 CStatic类提供一个windows静态控件性能。一个静态控件用来显示一个文本字符串,框,矩形,图标,光标,位图,或者增强的图元文件。 它可以被用来作为标签,框,或用来分隔其他控件。一个静态控件不接受输入,也不提供输出;但是。如果它使用SS_NOTIFY风格创建的,...
CStatic::GetEnhMetaFile擷取先前使用SetEnhMetaFile設定的增強型元檔句柄。 CStatic::GetIcon擷取先前使用SetIcon設定之圖示的句柄。 CStatic::SetBitmap指定要顯示在靜態控件中的點陣圖。 CStatic::SetCursor指定要顯示在靜態控件中的游標影像。 CStatic::SetEnhMetaFile指定要在靜態控件中顯示的增強型元檔。
CStatic We use optional cookies to improve your experience on our websites, such as through social media connections, and to display personalized advertising based on your online activity. If you reject optional cookies, only cookies necessary to provide you the services will be used. You may ...
你可能觉得对所有的控件使用统一的界面设置觉得不自由其实vc同样可以对特定的id的控件进行设置方法如下 CStatic设置文字、字体、颜色和OnCtlColor的使用 BOOL CreateFont( int nHeight, int nWidth, int nEscapement, int nOrientation, int nWeight, BYTE bItalic, BYTE bUnderline, BYTE cStrikeOut, BYTE nCharSet...
First, call the constructor to construct the CStatic object, then call the Create method to create the static control and attach it to the CStatic object. If you create a CStatic object within a dialog box, through a dialog resource, the CStatic object is automatically destroyed when the user...
CStatic Class Members Member Functions Member Functions CStatic::Create CStatic::CStatic CStatic::GetBitmap CStatic::GetCursor CStatic::GetEnhMetaFile CStatic::GetIcon CStatic::SetBitmap CStatic::SetCursor CStatic::SetEnhMetaFile CStatic::SetIconLearn...