 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
spleenth@gmail.com Guest
|
Posted: Fri Aug 12, 2005 3:32 pm Post subject: Hybride: SpeedButton, Checkbox and Image |
|
|
Hello,
I try to make my control change state of other controls of the same
type when they have the same GroupIndex set...
All I get is Access Violation :(
could you please take a look at my code and tell me what is wrong?
Excerpt that makes problems:
________________________________________________________
procedure TxImage.Click;
var i, cc: integer;
begin
inherited;
if FGroupIndex <> 0 then
FChecked := True
else
FChecked := not FChecked;
if Assigned(PictureON) and Assigned(PictureOFF) Then
if FChecked then Picture.Bitmap := PictureON.Bitmap
else Picture.Bitmap := PictureOFF.Bitmap;
//THIS PART MAKES PROBLEMS ((((
if (FGroupIndex <> 0) and (Parent <> nil) and FChecked then
begin
cc := Parent.controlCount -1;
with Parent do
begin
for i := 0 to cc do
if Parent.Controls[i] is TxImage then
if TxImage(Parent.Controls[i]).FGroupIndex = FGroupIndex then
begin
TxImage(Parent.Controls[i]).Checked := False;
TxImage(Parent.Controls[i]).Invalidate;
end;
end;
end;
//THIS PART MAKES PROBLEMS ((((
invalidate;
end;
________________________________________________________
whole code here:
http://rafb.net/paste/results/qWkjL977.html
Thanks in advance!
~spleen
|
|
| Back to top |
|
 |
spleenth@gmail.com Guest
|
Posted: Fri Aug 12, 2005 5:04 pm Post subject: Re: Hybride: SpeedButton, Checkbox and Image |
|
|
Spleenth said:
[...]
my friend has helped me, and here is the final version that works:
http://rafb.net/paste/results/LbtpCl48.html
you may use it and modify as you wish -.^
Cheers!
~spleen
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|