pro_imaj Posted April 22, 2016 Share Posted April 22, 2016 Merhaba; UniPropertyGrid AttachedComponent özelliğindeki Gride gelen verileri Dışarıya aktarma ve sonrasında da tam tersi içeriye almayı yapabilir miyiz. Örnek. Runtime'da bir nesne oluşturduğumuzu varsayalım. 1-AttachedComponent gelen değerleri kullanıcı düzenledi, kaydet tuşu ile bu verileri herhangi bir formatta dışarı almak. 2-Dışarıya alınan nesnenin son özelliklerini Form Create olurken kayıtlı yerden nesneye tekrar yüklemek. Property : AttachedComponent / Export/Import Teşekkürler. Quote Link to comment Share on other sites More sharing options...
bugra Posted April 22, 2016 Share Posted April 22, 2016 merhabalar Stream ile componentleri kaydedebilirsiniz. Örneğin kayıt için bir buton ekleyip şuna benzer bir kodla attached componenti save edebilirsiniz procedure TMainForm.UniSaveButtonClick(Sender: TObject); var Stream: TFileStream; begin Stream := TFileStream.Create(UniServerModule.StartPath+'mycomponent.dat', fmCreate); try Stream.WriteComponent(UniPropertyGrid1.AttachedComponent); finally Stream.Free; end; end; Form oncreate anında da şu kodla çağırabilirsiniz procedure TMainForm.UniFormCreate(Sender: TObject); var Stream: TFileStream; begin if FileExists(UniServerModule.StartPath+'mycomponent.dat') then begin Stream := TFileStream.Create(UniServerModule.StartPath+'mycomponent.dat', fmOpenRead); try Stream.ReadComponent(UniPropertyGrid1.AttachedComponent); finally Stream.Free; end; end; end; Quote Link to comment Share on other sites More sharing options...
pro_imaj Posted April 25, 2016 Author Share Posted April 25, 2016 Teşekkür ederim. İyi çalışmalar. Quote Link to comment Share on other sites More sharing options...
pro_imaj Posted April 28, 2016 Author Share Posted April 28, 2016 Merhaba; Örnekleri inceledğimde Lisbox'un Item özelliği gibi bazı özelliklerin gelmediğini görüyorum, bunları nasıl ekleyebiliriz. Teşekkürler. Quote Link to comment Share on other sites More sharing options...
bugra Posted April 28, 2016 Share Posted April 28, 2016 Merhabalar; Evet UniPropertyGrid'e attach edilen componentin bazı özellikleri property grid'e gelmeyebilir. Bu durumda bu özellikleri başka bir yerde (bir panelde, frame içerisinde, farklı bir formda) tanımlayabilirsiniz. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.