Jump to content

Button ile Başka Bir Elementi Kontrol Etme


halil355

Recommended Posts

hayırlı aksamlar KintaRo hocam,bu seferki sorum buton hakkında.2 tane buton düsünelim ama ilk butonun üzerine geldigimizde digeride aynı sekilde etkilenmesini istiyorum.1.butona basınca 2.side basılmıs gibi rengi degissin.nasıl yapabiliriz hocam bunu...

Link to comment
Share on other sites

Öncelikle bir button tablosu oluşturup oraya buttonların olmasini istediğin ayarları girersin ve Button.SetProperties komutu ile bu tabloyu buttonlara uygularsın

-- BUTTON ÖZELLİKLERİ TABLOSU
tblBtnProps = {};
--tblBtnProps.ButtonFile = ""; -- button dosyası (buna şu an için gerek yok)
tblBtnProps.Text = "tiklandi"; -- buttonun üstünde yazan metin
tblBtnProps.FontName = "Verdana"; -- Button Font tipi
tblBtnProps.FontSize = 15; -- font boyutu
tblBtnProps.FontWeight = FW_BOLD; -- font kalın/ince/
tblBtnProps.FontItalic = false; -- font italic/normal
tblBtnProps.FontStrikeout = false; --üstü çizili 
tblBtnProps.FontScript = ANSI_CHARSET; -- kodlama
tblBtnProps.FontAntiAlias = true; -- 
tblBtnProps.FontUnderline = false; -- altı çizili
tblBtnProps.XOffset = 0; 
tblBtnProps.YOffset = 0;
tblBtnProps.LeftMargin = 0;
tblBtnProps.RightMargin = 0;
tblBtnProps.Style = BTNSTYLE_STANDARD; -- stil
tblBtnProps.ToggleState = BTN_TOGGLE_UP; -- basık/ normal
tblBtnProps.Cursor = CURSOR_HAND; -- mouse işaretçisi
tblBtnProps.TooltipText = ""; -- açıklama yazısı
--tblBtnProps.Y = 0; -- yukaridan aşağıya pozisyonu
--tblBtnProps.X = 0; -- soldan sağa pozisyonu (buttonun yerini değiştirmeyeceksen bunlara gerek yok)
--tblBtnProps.Height = 54; -- buttonun uzunluğu
--tblBtnProps.Width = 198; -- buttonun genişliği
tblBtnProps.Enabled = true; -- aktif/pasif
tblBtnProps.Visible = true; -- görünür/görünmez
tblBtnProps.ResizeLeft = false; 
tblBtnProps.ResizeRight = false;
tblBtnProps.ResizeTop = false;
tblBtnProps.ResizeBottom = false;
tblBtnProps.HighlightSound = SND_STANDARD;
tblBtnProps.HighlightSoundFile = "";
tblBtnProps.ClickSound = SND_STANDARD;
tblBtnProps.ClickSoundFile = "";
tblBtnProps.ColorNormal = Math.HexColorToNumber("777777"); -- renk
tblBtnProps.ColorHighlight = Math.HexColorToNumber("777777"); -- renk
tblBtnProps.ColorDown = Math.HexColorToNumber("777777"); -- renk
tblBtnProps.ColorDisabled = Math.HexColorToNumber("777777"); -- renk
tblBtnProps.Alignment = ALIGN_CENTER;

Button.SetProperties("Button1", tblBtnProps) -- tabloyu 1. buttona uygula
Button.SetProperties("Button2", tblBtnProps)-- tabloyu 2. buttona uygula

Bu ayarları saklamak istersen buttona basınca ayarları ini dosyasına kaydettirip, Sayfanın On Show evresinden tekrar ini dosyasından çağırıp buttonlara aktarabilirsin. Dene olmazsa bir örnek hazırlarım.

Link to comment
Share on other sites

Yukarda tablo özelliklerinin yanlarına açıklamalarını yazdım. Hangi özellikleri değiştirmek istiyorsan onları belirt ona göre ayarlayalım kodlarımızı.

hocam örnege bakarak istedigimi yaptim cok sagol...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...