Jump to content

Question.... On EditBox


Recommended Posts

Like this: BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN)

sample:

$Edit1 = GUICtrlCreateEdit("", 88, 32, 233, 225, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
[size="5"] [/size]
Link to comment
Share on other sites

Remove the default $WS_VSCROLL and $WS_HSCROLL styles:

GUICtrlCreateEdit("Text", $X, $Y, $W, $H, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_VSCROLL + $WS_HSCROLL))

:mellow:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

No mini.It didnt popups:*May be i misunderstand your second question cuz my english awfull)

Here is sample script:

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=Form2.kxf
$Form2 = GUICreate("Form2", 413, 298, 302, 218)
$Edit1 = GUICtrlCreateEdit("", 88, 32, 233, 225, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, "Edit1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
[size="5"] [/size]
Link to comment
Share on other sites

No mini.It didnt popups:*May be i misunderstand your second question cuz my english awfull)

Here is sample script:

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=Form2.kxf
$Form2 = GUICreate("Form2", 413, 298, 302, 218)
$Edit1 = GUICtrlCreateEdit("", 88, 32, 233, 225, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, "Edit1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

Thx for all replays, i understand perfectly, i got my gui working....

But will im using your way, i found that if i pass the rigth to left with text, it dosent show the scrolling bar.

I was wandoring if it can show the scroll bar, if in the editbox, the text passed the "size" of the box...

Heres my code of the gui im making.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <TabConstants.au3>

#Region ### START Koda GUI section ### Form=
Dim $Version = "1"
Dim $Start = 0

;Main.
$GUI = GUICreate("Base de Contactos BES", 537, 451)


$PageControl1 = GUICtrlCreateTab(10, 10, 516, 432)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("Dados Basicos")

;BackGround
$pic = GuiCtrlCreatePic(@ScriptDir & "\BES" & "\BES.jpg" ,11, 31, 512, 410)
GUICtrlSetState(-1,$GUI_DISABLE)

;Input
$InputN_Adesao = GUICtrlCreateInput("IDCB", 24, 88, 169, 21)

;Buttons
$Procurar = GUICtrlCreateButton("Procurar", 24, 48, 75, 25)

;Input
$InputNome = GUICtrlCreateInput("", 24, 144, 169, 21)
$InputContacto = GUICtrlCreateInput("", 24, 200, 169, 21)
$InputEmail = GUICtrlCreateInput("", 24, 256, 169, 21)
$InputUltimoContacto = GUICtrlCreateInput("", 24, 312, 169, 21)
$InputProximoContacto = GUICtrlCreateInput("", 24, 368, 169, 21)

;Buttons
$Gravar = GUICtrlCreateButton("Gravar", 24, 400, 75, 25)
$Limpar = GUICtrlCreateButton("Limpar", 112, 400, 75, 25)
$Apagar = GUICtrlCreateButton("Apagar", 120, 48, 75, 25)

;Label
$LabelNome = GUICtrlCreateLabel("Nome", 24, 120, 83, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$LabelContacto = GUICtrlCreateLabel("Contacto", 24, 176, 83, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$LabelEMail = GUICtrlCreateLabel("EMail", 24, 232, 83, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$LabelUltimoContacto = GUICtrlCreateLabel("Ultimo Contacto", 24, 288, 83, 17)
GUICtrlSetColor(-1, 0xFFFFFF)
$LabelProximoContacto = GUICtrlCreateLabel("Proximo Contacto", 24, 344, 83, 17)
GUICtrlSetColor(-1, 0xFFFFFF)

$EditBox_Obs = GUICtrlCreateEdit("", 216, 48, 289, 377, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_VSCROLL + $WS_HSCROLL))

$TabSheet3 = GUICtrlCreateTabItem("Depositos")
;Editbox
$EditBox_Depositos = GUICtrlCreateEdit("", 20, 40, 493, 390, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_VSCROLL + $WS_HSCROLL))

$TabSheet7 = GUICtrlCreateTabItem("Titulos")
;Editbox
$EditBox_Titulos = GUICtrlCreateEdit("", 20, 40, 493, 390, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_VSCROLL + $WS_HSCROLL))

$TabSheet4 = GUICtrlCreateTabItem("FI")
;Editbox
$EditBox_FI = GUICtrlCreateEdit("", 20, 40, 493, 390, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_VSCROLL + $WS_HSCROLL))

$TabSheet5 = GUICtrlCreateTabItem("BSV")
;Editbox
$EditBox_BSV = GUICtrlCreateEdit("", 20, 40, 493, 390, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_VSCROLL + $WS_HSCROLL))

$TabSheet6 = GUICtrlCreateTabItem("SNV")
;Editbox
$EditBox_SNV = GUICtrlCreateEdit("", 20, 40, 493, 390, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_VSCROLL + $WS_HSCROLL))

$TabSheet7 = GUICtrlCreateTabItem("SV")
;Editbox
$EditBox_SV = GUICtrlCreateEdit("", 20, 40, 493, 390, BitXOR($GUI_SS_DEFAULT_EDIT, $WS_VSCROLL + $WS_HSCROLL))

GUICtrlCreateTabItem("")

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case -3
            _Check4CLOSEClicked()
        Case $Gravar
            _Check4Gravar() 
        Case $Limpar
            _Check4Limpar() 
        Case $Procurar
            _Check4Procurar()
        Case $Apagar
            _Check4Apagar()
    EndSwitch
WEnd

Func _Check4CLOSEClicked();Exit
$answer = MsgBox(36, "Wanning", "Are you sure?", 8 )
If $answer = 6 Then
    Exit
EndIf   
EndFunc

Func _Check4Apagar()
    $answer = MsgBox(36, "Wanning", "Are you sure?", 8 )
If $answer = 6 Then
IniDelete ( "Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao))
EndIf   
    EndFunc
Func _Check4Procurar()
GUICtrlSetData ($InputNome, IniRead ("Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Nome", "Informação não encontrada"))
GUICtrlSetData ($InputContacto, IniRead ("Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Contacto", "Informação não encontrada"))
GUICtrlSetData ($InputEmail, IniRead ("Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Email", "Informação não encontrada"))
GUICtrlSetData ($EditBox_Obs, IniRead ("Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Observações", "Informação não encontrada"))
GUICtrlSetData ($InputUltimoContacto, IniRead ("Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Ultimo Contacto", "Informação não encontrada"))
GUICtrlSetData ($InputProximoContacto, IniRead ("Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Proximo Contacto", "Informação não encontrada"))
EndFunc

Func _Check4Limpar()
 GuiCtrlSetData ($InputN_Adesao, "")
 GuiCtrlSetData ($InputNome, "")
 GuiCtrlSetData ($InputContacto, "")
 GuiCtrlSetData ($InputEmail, "")
 GuiCtrlSetData ($EditBox_Obs, "")
 GuiCtrlSetData ($InputUltimoContacto, "")
 GuiCtrlSetData ($InputProximoContacto, "")
EndFunc

Func _Check4Gravar()
        $answer = MsgBox(36, "Wanning", "Tem a certeza que quer gravar?", 8 )
        If $answer = 6 Then
    IniWrite ( "Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Nome" , GUICtrlRead($InputNome))
    IniWrite ( "Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Contacto" , GUICtrlRead($InputContacto))
    IniWrite ( "Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Email" , GUICtrlRead($InputEmail))
    IniWrite ( "Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Observações" , GUICtrlRead($EditBox_Obs))
    IniWrite ( "Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Ultimo Contacto" , GUICtrlRead($InputUltimoContacto))
    IniWrite ( "Base de Contactos BES.ini", GUICtrlRead($InputN_Adesao) , "Proximo Contacto" , GUICtrlRead($InputProximoContacto))
    EndIf   
EndFunc
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...