buton ile listeye yazı aktarmak - Çözüldü

Programlama ve Script dilleri konusunda bilgi paylaşım alanıdır.
Cevapla
darendeli
Byte4
Byte4
Mesajlar: 195
Kayıt: 06 Haz 2016, 16:55
Teşekkür etti: 1 kez
Teşekkür edildi: 6 kez

buton ile listeye yazı aktarmak - Çözüldü

Mesaj gönderen darendeli »

Butona basılınca belirledigim yazıyı listeye aktarmasını istiyorum 1 kac farkli buton ve yazı olacak hangisine basılırsa onu list e aktaracak

Kod: Tümünü seç

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 602, 386, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 24, 16, 257, 25)
$Button2 = GUICtrlCreateButton("Button2", 24, 48, 259, 25)
$Button3 = GUICtrlCreateButton("Button3", 24, 80, 259, 25)
$Button4 = GUICtrlCreateButton("Button4", 24, 112, 259, 25)
$List1 = GUICtrlCreateList("", 304, 8, 289, 370)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

	EndSwitch
WEnd
En son darendeli tarafından 09 Ağu 2016, 21:31 tarihinde düzenlendi, toplamda 2 kere düzenlendi.
Kullanıcı avatarı
BlueLife
Kilobyte1
Kilobyte1
Mesajlar: 293
Kayıt: 29 Ağu 2014, 20:42
Teşekkür etti: 54 kez
Teşekkür edildi: 70 kez

Re: buton ile listeye yazı aktarmak

Mesaj gönderen BlueLife »

Örnegine ek yapayım sen kurcalarsın.

Kod: Tümünü seç

Local $Form1 = GUICreate("Form1", 602, 386, 192, 124)
Local $Button1 = GUICtrlCreateButton("Button1", 24, 16, 257, 25)
Local $Button2 = GUICtrlCreateButton("Button2", 24, 48, 259, 25)
Local $Button3 = GUICtrlCreateButton("Button3", 24, 80, 259, 25)
Local $Button4 = GUICtrlCreateButton("Button4", 24, 112, 259, 25)
Local $Button5 = GUICtrlCreateButton("Temizle", 24, 140, 259, 25)
Local $List1 = GUICtrlCreateList("", 304, 8, 289, 370)

GUISetState(@SW_SHOW)
Local $nMsg
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case -3
			Exit
		Case $Button1
			_Insert_Text(1, $List1)
		Case $Button2
			_Insert_Text(2, $List1)
		Case $Button3
			_Insert_Text(3, $List1)
		Case $Button4
			_Insert_Text(4, $List1)

		Case $Button5
			GUICtrlSetData($List1, "")
	EndSwitch
WEnd

Func _Insert_Text($TextNum, $CtlrId = -1)

	Local $Text
	Switch Number($TextNum)
		Case 1
			$Text = "Yazı 1|"
		Case 2
			$Text = "Yazı 2|"
		Case 3
			$Text = "Yazı 3|"
		Case 4
			$Text = "Yazı 4|"
			; ... cogaltarak devam edebilirsin
	EndSwitch

	If StringLen($Text) > 0 Then GUICtrlSetData($CtlrId, $Text)
EndFunc   ;==>_Insert_Text
darendeli
Byte4
Byte4
Mesajlar: 195
Kayıt: 06 Haz 2016, 16:55
Teşekkür etti: 1 kez
Teşekkür edildi: 6 kez

Re: buton ile listeye yazı aktarmak

Mesaj gönderen darendeli »

cok tesekkürler sorun cözülmüstür
Cevapla

“Programlama ve Script dilleri” sayfasına dön