想去掉一个窗口的边框和改变按钮的颜色,请问如果操作?
我想把下段代码的边框,窗口标题等内容去掉,只下中间的编辑区,并且改变按钮颜色,请高手指教,谢谢.#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
$hWnd = GUICreate("GDI+ 示例", 400, 300)
GUISetState()
_GDIPlus_Startup()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
_GDIPlus_GraphicsClear($hGraphics)
$hBrush = _GDIPlus_BrushCreateSolid(0xFF009900)
$hFamily = _GDIPlus_FontFamilyCreate("Arial")
$hFont = _GDIPlus_FontCreate($hFamily, 36)
$hLayout = _GDIPlus_RectFCreate(0, 0, 400, 300)
$hStringFormat = _GDIPlus_StringFormatCreate()
_GDIPlus_StringFormatSetAlign($hStringFormat, 1)
_GDIPlus_GraphicsDrawStringEx($hGraphics, "AutoIt Rocks", $hFont, $hLayout, $hStringFormat, $hBrush)
$btn=GUICtrlCreateButton ("确定",235, 220, 50)
$msg = 0
While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()
Select
Case $msg = $btn
exitloop
EndSelect
Wend
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_FontDispose($hFont)
_GDIPlus_StringFormatDispose($hStringFormat)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$hWnd = GUICreate("GDI+ 示例", 400, 300,-1,-1,$WS_POPUP)
GUISetState()
_GDIPlus_Startup()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
_GDIPlus_GraphicsClear($hGraphics)
$hBrush = _GDIPlus_BrushCreateSolid(0xFF009900)
$hFamily = _GDIPlus_FontFamilyCreate("Arial")
$hFont = _GDIPlus_FontCreate($hFamily, 36)
$hLayout = _GDIPlus_RectFCreate(0, 0, 400, 300)
$hStringFormat = _GDIPlus_StringFormatCreate()
_GDIPlus_StringFormatSetAlign($hStringFormat, 1)
_GDIPlus_GraphicsDrawStringEx($hGraphics, "AutoIt Rocks", $hFont, $hLayout, $hStringFormat, $hBrush)
$btn=GUICtrlCreateButton ("确定",235, 220, 50)
$msg = 0
While $msg <> $GUI_EVENT_CLOSE
$msg = GUIGetMsg()
Select
Case $msg = $btn
exitloop
EndSelect
Wend
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_FontDispose($hFont)
_GDIPlus_StringFormatDispose($hStringFormat)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown() 在按钮下面加上GUICtrlSetBkColor (-1, 0xff0000)可以设置按钮背景颜色
GUICtrlSetColor ( 控件ID, 文本颜色)可以设置按钮文本颜色 回复 2# zhouhaijin
这样去不掉边框 回复 4# netegg
应该版本问题,我去掉了 本帖最后由 netegg 于 2015-1-12 12:13 编辑
回复 5# zhouhaijin
发个图上来,边框不止像lz说的有宽度的,包括外边线 学习了,感谢分享! 回复 6# netegg
边线就不知道了,改颜色还没试。现在在外面,等下回去试试 我是来学习的。。 回复 6# netegg
回复 6# netegg
应该版本问题,我边线也没有 #include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>
_Main()
Func _Main()
Local $hGUI, $hGraphic, $hBrush, $hFormat, $hFamily, $hFont, $tLayout
Local $sString = "Hello world", $aInfo
; 创建 GUI
$hGUI = GUICreate("GDI+", 400, 300,@DesktopWidth-450,@DesktopHeight-350,$WS_POPUP)
GUISetBkColor(0x000000)
GUISetState()
; 描绘字符串
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
$hBrush = _GDIPlus_BrushCreateSolid(0xFF00007F)
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Arial")
$hFont = _GDIPlus_FontCreate($hFamily, 12, 2)
$tLayout = _GDIPlus_RectFCreate(140, 110, 0, 0)
$aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sString, $hFont, $tLayout, $hFormat)
_GDIPlus_GraphicsDrawStringEx($hGraphic, $sString, $hFont, $aInfo, $hFormat, $hBrush)
; 循环直到用户退出
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; 清理资源
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
EndFunc ;==>_Main
支持,进来学习下 学习学习。。。。。。。。。。。。。。。。。。
页:
[1]