Jump to content

Guide Ekle Kaldır Butonuna Görev Verme Sorunu


x_files_x
 Share

Recommended Posts

Mrb arkadaşlar geçenlerde bişi aklıma geldi dedim yapar mıyım, şöyle bişi yapmak istedim:

Gui nin ekle ve çıkart butonlar ıvar, comboya bişi yazıp eklersek listeye eklicek, cıkart dersekte cıkartıcak ve ayrıca comboya yazdıgım isim listede var ise onu bulucak, bir çeşit müşteri ekleme çıkart bulma programı gibi bişi, bana cok lazım oldugundan degil ama öğrenmek adına uğraşıyorum örnek gui burda ama sadece temayı tasarladım pek komutları yapamadım

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiListBox.au3>
#include <GuiListView.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Global $Dosya = "C:\WINDOWS\Entegrasyon.ini"
Global $MusteriData = StringStripWS(IniRead($Dosya,"Data","Musteri",""), 3)



$Form1_1 = GUICreate("Form1", 405, 334, 190, 126)
GUISetBkColor(0x9DB9EB)
$musteri = GUICtrlCreateCombo("Combo1", 24, 32, 265, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
;~ GUICtrlSetData(-1,$MusteriData ,"")
GUICtrlSetColor(-1, 0x800080)
$Group1 = GUICtrlCreateGroup("Group1", 8, 8, 297, 65)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$musteri_btn2 = GUICtrlCreateButton("Ekle", 320, 24, 59, 17)
$musteri_btn1 = GUICtrlCreateButton("Çıkart", 320, 48, 59, 17)
$Group2 = GUICtrlCreateGroup("", 312, 8, 81, 65)
GUICtrlCreateGroup("", -99, -99, 1, 1)

Global $Items = GUICtrlCreateList("", 8, 80, 297, 240)
Global $Items = $MusteriData, $Items_S = StringSplit($Items, "|")
GUICtrlSetData(-1, $Items)
$Pic1 = GUICtrlCreatePic(@ScriptDir & "/script.jpg", 312, 80, 84, 244)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

	EndSwitch
WEnd

Edited by x_files_x
Link to comment
Share on other sites

Üst kısımda sadece ekleme bölümü olsa, listeden bir öge seçip silme ve düzenleme işlevi olsa daha iyi olur. Hem liste hem combobox kullanıp işi uzatmaya gerek yok.

Resimdeki gibi:

yvSJSBB.png

Link to comment
Share on other sites

[warning][color=#FF0000][b]DİKKAT: Konu Başlığını forum Kurallarına gore yeniden düzenleyiniz. Aksi halde cope tasınacaktır.

[topic=872]Forum Kuralları[/topic] - [ Madde 10-16 ]

Konu düzenlenene kadar yazılan tüm iletiler silinecek, ileti yazanlar uyarı alacaktır.[/b][/color][/warning]

Link to comment
Share on other sites

Bir örnek hazırladım. Gerekli değişiklikleri yaparak soyad, yaş gibi kısımlar ekleyebilirsiniz.

[spoiler]

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

#Region ### START Koda GUI section ### Form=C:\Users\Admin\Desktop\Form1_1.kxf
$Form1_1 = GUICreate("Form1", 406, 335, 238, 159)
GUISetBkColor(0x9DB9EB)
$Group1 = GUICtrlCreateGroup("Kayıt", 8, 8, 385, 65)
$Input1 = GUICtrlCreateInput("Input1", 104, 32, 241, 21)
$Label1 = GUICtrlCreateLabel("Adı ve Soyadı:", 24, 32, 72, 17)
$Button1 = GUICtrlCreateButton("+", 352, 32, 25, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup("", 312, 88, 81, 65)
$musteri_btn2 = GUICtrlCreateButton("Düzenle", 320, 104, 59, 17)
$musteri_btn1 = GUICtrlCreateButton("Sil", 320, 128, 59, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Items = GUICtrlCreateList("", 8, 88, 297, 240)
GuiCtrlSetData(-1, IniRead(@AppDataDir & "\kisiler.ini", "kullanıcılar", "adlar", ""))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Func _ReadItems()
	Local $iCnt = _GUICtrlListBox_GetCount($Items)
	Local $sMsg = ""
	For $n = 0 To $iCnt - 1
	    $sMsg &= _GUICtrlListBox_GetText($Items, $n) & "|"
	Next
	Return $sMsg
EndFunc

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $Button1
			If Not StringInStr(IniRead(@AppDataDir & "\kisiler.ini", "kullanıcılar", "adlar", "") & "|", GUICtrlRead($Input1)) Then
				IniWrite(@AppDataDir & "\kisiler.ini", "kullanıcılar", "adlar", _ReadItems() & GUICtrlRead($Input1))
			EndIf

			GuiCtrlSetData($Items, "")
			GuiCtrlSetData($Items, IniRead(@AppDataDir & "\kisiler.ini", "kullanıcılar", "adlar", ""))
	EndSwitch
WEnd

[/spoiler]

Edited by reyiz
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...