Sayfayı Yazdır | Pencereyi Kapat

Label refresh etme

Nereden Yazdırıldığı: Clomosy | Forum
Kategori: Genel Programlama
Forum Adı: Clomosy ile değişken kullanımı
Forum Tanımlaması: TRObject dili ile değişken tanımlaması ve ekranda gösterme
URL: https://forum.clomosy.com.tr/forum_posts.asp?TID=1351
Tarih: 17 Şubat 2026 Saat 17:19
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: Label refresh etme
Mesajı Yazan: sudee.tanerr
Konu: Label refresh etme
Mesaj Tarihi: 17 Şubat 2026 Saat 13:34

void sifirlama;
var
  i:Integer;
  bulundu:Boolean;
  tempLabel: TClProLabel;
  oyunBitti:Boolean;
{
  rastgeleIndex = clMath.GenerateRandom(0, 80); 
  kelime = kelimeler[rastgeleIndex];
  secilenIpucu = ipucular[rastgeleIndex];
  hatasayisi = 0;
  oyunBitti = False;
  popupPanel.Visible = False;
  iskelet.opacity=0;
  iskelet.SetclProSettings(iskelet.clProSettings);

  for (i = 1 to Length(kelime)) 
{
  tempLabel = TClProLabel(myform.FindComponent('label' + IntToStr(i)));
  if (tempLabel <> nil) {
    if (i <= Length(kelime)) {
       tempLabel.Text = ' _ ';
       tempLabel.Visible = True;
    } 
    else
    {
      tempLabel.Visible = False;
    }
  }
}

  ShowMessage('Oyun Sıfırlandı! Başarılar.');
  ipucuBtn.Enabled=True;
  ipucuLabel.Visible=False;
  iskelet.opacity=0;
  iskelet.SetclProSettings(iskelet.clProSettings);

    if(hatasayisi==0) { iskelet.clProSettings.PictureSource = 'bos';}
    else if (hatasayisi == 1) { iskelet.clProSettings.PictureSource = 'kafaa'; }
    else if (hatasayisi == 2) { iskelet.clProSettings.PictureSource = 'govdee'; }
    else if (hatasayisi == 3) { iskelet.clProSettings.PictureSource = 'tekkoll'; }
    else if (hatasayisi == 4) { iskelet.clProSettings.PictureSource = 'ciftkoll'; }
    else if (hatasayisi == 5) { iskelet.clProSettings.PictureSource = 'tekbacakk'; }
    else if (hatasayisi == 6) { iskelet.clProSettings.PictureSource = 'tamm'; }

}
labellarımın kelimeye göre uzunluğunu ve içindeki harfleri temizlemek için ne yapmam gerekiyor
https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon="{"version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}" crossorigin="anonymous">



Cevaplar:
Mesajı Yazan: sudee.tanerr
Mesaj Tarihi: 17 Şubat 2026 Saat 13:52

void HarfKontrol;
var
  basilanButon:TclProButton;
  basilanHarf:String;
  j,k:Integer;
  bulundu:Boolean;
  tempComp,kontrolLabel: TClProLabel;
  oyunBitti:Boolean;
{
  basilanButon =TClProButton(myform.Clsender);
  basilanHarf =basilanButon.Text;
  bulundu=False;

  for (j=1 to Length(kelime))
  {
    if (Copy(kelime, j, 1) == basilanHarf)
    {
      tempComp = TClProLabel(myform.FindComponent('label' + IntToStr(j)));
      //labeli elinde tutup gideceği yere yerleştirir
      if (tempComp <> nil)
      {
        tempComp.Text = basilanHarf;
        bulundu = True;
      }}}

  if(bulundu==False)
  {
    ShowMessage(basilanHarf +' harfi bulunmamaktadır...');
    hatasayisi=hatasayisi+1;
    if(hatasayisi==0) { iskelet.clProSettings.PictureSource = 'bos';}

    else if (hatasayisi == 1) { iskelet.clProSettings.PictureSource = 'kafaa'; }
    else if (hatasayisi == 2) { iskelet.clProSettings.PictureSource = 'govdee'; }
    else if (hatasayisi == 3) { iskelet.clProSettings.PictureSource = 'tekkoll'; }
    else if (hatasayisi == 4) { iskelet.clProSettings.PictureSource = 'ciftkoll'; }
    else if (hatasayisi == 5) { iskelet.clProSettings.PictureSource = 'tekbacakk'; }
    else if (hatasayisi == 6) { iskelet.clProSettings.PictureSource = 'tamm'; }

    //resimlerin değişmesini sağlar
    iskelet.SetclProSettings(iskelet.clProSettings);
    if (hatasayisi == 6) {
      ShowMessage('Hakkınız bitti! Kaybettiniz... Kelime: ' + kelime);
      popupPanel.Visible = True;
      sifirlama();
    }
    }
    oyunBitti = True;
  for (k = 1 to Length(kelime))
  {
    kontrolLabel = TClProLabel(myform.FindComponent('label' + IntToStr(k)));
    if (kontrolLabel.Text == ' _ ') 
    {
      oyunBitti = False;
    }
  }
  
  if (oyunBitti == True)
  {
    ShowMessage('Tebrikler! Kelimeyi ' + IntToStr(hatasayisi) + ' hata ile bildiniz: ' + kelime);
    ShowMessage('Tebrikler Kazandınız...');
    popupPanel.Visible = True;
    sifirlama();
  }
  } ve bu harf kontrolu yapan kısım
https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon="{"version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}" crossorigin="anonymous">


Mesajı Yazan: sudee.tanerr
Mesaj Tarihi: 17 Şubat 2026 Saat 15:18

void sifirlama;
  var
  tempBtn: TClProButton;
  tempLabel: TClProLabel;
  k: Integer;
{

  rastgeleIndex = clMath.GenerateRandom(0, 80); 
  kelime = kelimeler[rastgeleIndex];
  
  secilenIpucu = ipucular[rastgeleIndex];
  ipucuLabel.Text = 'İpucu: ' + secilenIpucu;
  ipucuBtn.Enabled = True;
  ipucuLabel.Visible = False;

  hatasayisi = 0;
  if (popupPanel <> nil) popupPanel.Visible = False;
  if (ipucubtn <> nil) ipucubtn.Enabled = True;

  // 3. İskeleti Sıfırla
  if (iskelet <> nil) {
    iskelet.opacity = 0;
    iskelet.clProSettings.PictureSource = 'bos';
    iskelet.SetclProSettings(iskelet.clProSettings);
  }

  //labelların fazlaları sil
  for (k = 1 to 30) {
    tempLabel = TClProLabel(myform.FindComponent('label' + IntToStr(k)));
    if (tempLabel <> nil) {
      if (k <= Length(kelime)) 
      {
        tempLabel.Text = ' _ ';
        tempLabel.Visible = True;
      }
      else
      {
        tempLabel.Visible = False;
      }
    }
  }
  for (k = 1 to 29) {
    tempBtn = TClProButton(myform.FindComponent('harf' + IntToStr(k)));
    if (tempBtn <> nil) {
      tempBtn.Enabled = True;
    }
  }
  ShowMessage('Yeni oyun başladı! Başarılar.');
  }
void HarfKontrol;
var
  basilanButon:TclProButton;
  basilanHarf:String;
  j,k:Integer;
  bulundu:Boolean;
  tempComp,kontrolLabel: TClProLabel;
  oyunBitti:Boolean;
{
  basilanButon =TClProButton(myform.Clsender);
  basilanHarf =basilanButon.Text;
  bulundu=False;

  for (j=1 to Length(kelime))
  {
    if (Copy(kelime, j, 1) == basilanHarf)
    {
      tempComp = TClProLabel(myform.FindComponent('label' + IntToStr(j)));
      //labeli elinde tutup gideceği yere yerleştirir
      if (tempComp <> nil)
      {
        tempComp.Text = basilanHarf;
        bulundu = True;
      }}}

  if(bulundu==False)
  {
    ShowMessage(basilanHarf +' harfi bulunmamaktadır...');
    hatasayisi=hatasayisi+1;
    if(hatasayisi==0) { iskelet.clProSettings.PictureSource = 'bos';}

    else if (hatasayisi == 1) { iskelet.clProSettings.PictureSource = 'kafaa'; }
    else if (hatasayisi == 2) { iskelet.clProSettings.PictureSource = 'govdee'; }
    else if (hatasayisi == 3) { iskelet.clProSettings.PictureSource = 'tekkoll'; }
    else if (hatasayisi == 4) { iskelet.clProSettings.PictureSource = 'ciftkoll'; }
    else if (hatasayisi == 5) { iskelet.clProSettings.PictureSource = 'tekbacakk'; }
    else if (hatasayisi == 6) { iskelet.clProSettings.PictureSource = 'tamm'; }

    //resimlerin değişmesini sağlar
    iskelet.opacity=1;
    iskelet.SetclProSettings(iskelet.clProSettings);
    if (hatasayisi == 6) {
      ShowMessage('Hakkınız bitti! Kaybettiniz... Kelime: ' + kelime);
      popupPanel.Visible = True;
      //sifirlama(); buraya truedan false geçirir
    }
    }
    oyunBitti = True;
  for (k = 1 to Length(kelime))
  {
    kontrolLabel = TClProLabel(myform.FindComponent('label' + IntToStr(k)));
    if (kontrolLabel.Text == ' _ ') 
    {
      oyunBitti = False;
      Break;
    }
  }
  if (oyunBitti == True)
  {
    ShowMessage('Tebrikler! Kelimeyi ' + IntToStr(hatasayisi) + ' hata ile bildiniz: ' + kelime);
    ShowMessage('Tebrikler Kazandınız...');
    popupPanel.Visible = True;
    //sifirlama();
  }
  basilanButon.Enabled=False;
  }
hatamı bu şekilde çözdüm


Mesajı Yazan: M-Guney
Mesaj Tarihi: 17 Şubat 2026 Saat 15:32
Tebrikler hatanı çözmene sevindim. https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon="{"version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}" crossorigin="anonymous">



Sayfayı Yazdır | Pencereyi Kapat

Forum Software by Web Wiz Forums® version 12.07 - https://www.webwizforums.com
Copyright ©2001-2024 Web Wiz Ltd. - https://www.webwiz.net