不知道怎么说,就是修改一个GUICtrlCreateInput,另一个实时变动,看我的源码
就是我改动,电脑名称前缀或本机序号,本机名称会实时自动更改#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiIPAddress.au3>
$Form1 = GUICreate("Form1", 223, 249, 445, 117)
$LabelPrefix = GUICtrlCreateLabel("电脑名称前缀", 24, 64, 76, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
$Labelbjxh = GUICtrlCreateLabel("本机序号", 24, 96, 50, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
$Labelbjmc = GUICtrlCreateLabel("本机名称", 24, 32, 48, 20, $SS_CENTERIMAGE)
$InputPrefix = GUICtrlCreateInput("电脑", 104, 64, 100, 21)
$Inputbjxh = GUICtrlCreateInput("01", 104, 96, 100, 21)
$dnmc1=GUICtrlRead ( $InputPrefix )
$dnmc2=GUICtrlRead ( $Inputbjxh )
$Inputbjmc = GUICtrlCreateInput($dnmc1&$dnmc2, 104, 32, 100, 21)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd #include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
$Form1 = GUICreate("Form1", 223, 249, 445, 117)
$LabelPrefix = GUICtrlCreateLabel("电脑名称前缀", 24, 64, 76, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
$Labelbjxh = GUICtrlCreateLabel("本机序号", 24, 96, 50, 17, BitOR($SS_CENTER, $SS_CENTERIMAGE))
$Labelbjmc = GUICtrlCreateLabel("本机名称", 24, 32, 48, 20, $SS_CENTERIMAGE)
$InputPrefix = GUICtrlCreateInput("电脑", 104, 64, 100, 21)
$Inputbjxh = GUICtrlCreateInput("01", 104, 96, 100, 21)
Local $dnmc1,$dnmc2,$dnmc3
$dnmc1=GUICtrlRead ( $InputPrefix )
$dnmc2=GUICtrlRead ( $Inputbjxh )
$Inputbjmc = GUICtrlCreateInput($dnmc1&$dnmc2, 104, 32, 100, 21)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
$dnmc1=GUICtrlRead ( $InputPrefix )
$dnmc2=GUICtrlRead ( $Inputbjxh )
$dnmc3=GUICtrlRead ( $Inputbjmc )
If $dnmc3 <> $dnmc1&$dnmc2 Then GUICtrlSetData ( $Inputbjmc , $dnmc1&$dnmc2 )
WEnd这样的效果,是否如你所愿?? 我猜楼主是要如何改电脑名。。。 回复 2# 半芯竹
就是这样的,我试过好几种办法,原来这样就行啊!哈哈,我真笨! 回复 3# 502762378
是的,主要是改电脑名,但是最好改动前缀和序号的时候电脑名会自动改 不错呀,收藏
页:
[1]