AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren

Bind variables with components

Ein Thema von sk.Silvia · begonnen am 29. Apr 2006 · letzter Beitrag vom 29. Apr 2006
Antwort Antwort
Benutzerbild von sk.Silvia
sk.Silvia

Registriert seit: 8. Feb 2006
Ort: Slovenia
90 Beiträge
 
Delphi 7 Personal
 
#1

Bind variables with components

  Alt 29. Apr 2006, 19:58
hi there, lets say i have a checkbox and a boolean variable myvar, and i will that myvar=checkbox.checked

is there another way as to write

Delphi-Quellcode:
procedure TForm1.checkbox(Sender: TObject);
  begin
  myvar:=checkbox.checked;
  end;
like to bind the variable with the component, so each time i change the value of the component the value of a given variable will also be changed automaticly without any unnnecessary procedures and events...?
  Mit Zitat antworten Zitat
Benutzerbild von JasonDX
JasonDX
(CodeLib-Manager)

Registriert seit: 5. Aug 2004
Ort: München
1.062 Beiträge
 
#2

Re: Bind variables with components

  Alt 29. Apr 2006, 20:14
Since Checked is a property, accessed by private Methods, you cannot use (Method-)Pointers for that, but the RTTI might help you:
Delphi-Quellcode:
uses
  {...} TypInfo;
//...
  if GetPropValue(YourCheckbox, 'Checked') then
    ShowMessage('Checkbox is Checked');
Note: Although Delphi itself is not, the RTTI-Stuff in the .NET-Version of the VCL is case-sensitive

greetz
Mike
Mike
Passion is no replacement for reason
  Mit Zitat antworten Zitat
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 15:59 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz