Home » Developer & Programmer » Forms » what is the code to change propert of a button?  () 1 Vote
what is the code to change propert of a button? [message #173370] Mon, 22 May 2006 02:38 Go to next message
qewani
Messages: 51
Registered: December 2005
Location: uaq
Member
guys can any one tell me how to change by code the property of a push button from enabled to disabled??
Re: what is the code to change propert of a button? [message #173375 is a reply to message #173370] Mon, 22 May 2006 03:09 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Look at 'set_item_property'. But what do you mean by 'disable' a button? Try the 'visible' property. But I have this doubt as to whether you can 'disable' a button but I can't see it in the documentation.

David
Re: what is the code to change propert of a button? [message #173405 is a reply to message #173370] Mon, 22 May 2006 05:48 Go to previous messageGo to next message
qewani
Messages: 51
Registered: December 2005
Location: uaq
Member
ok David if my button name is add and the form name is student, so how would the code for changing the add button to visible no
any hints??!
Re: what is the code to change propert of a button? [message #173435 is a reply to message #173405] Mon, 22 May 2006 07:58 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
What's the name of the block?

David
Re: what is the code to change propert of a button? [message #173458 is a reply to message #173435] Mon, 22 May 2006 10:02 Go to previous messageGo to next message
saadatahmad
Messages: 452
Registered: March 2005
Location: Germany/Paderborn
Senior Member

SET_ITEM_PROPERTY('BLOCK_NAME.button_name', label, 'you_label');
SET_ITEM_PROPERTY('BLOCK_NAME.button_name', visible, property_false);

regards.
Re: what is the code to change propert of a button? [message #173544 is a reply to message #173370] Tue, 23 May 2006 02:00 Go to previous messageGo to next message
qewani
Messages: 51
Registered: December 2005
Location: uaq
Member
thanks Smile
Re: what is the code to change propert of a button? [message #173546 is a reply to message #173375] Tue, 23 May 2006 02:23 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
djmartin wrote on Mon, 22 May 2006 10:09

But I have this doubt as to whether you can 'disable' a button but I can't see it in the documentation.
Yes you can. I've attached a small example.
For those unable to download it: The form consists of
- an alert MYALERT
- a control block CTRL
- a push button PB_ENABLE_DISABLE with label 'Disable'
- a push button PB_NOTHING with label 'Nothing'

PB_ENABLE_DISABLE will switch the enabled property of push button PB_NOTHING. PB_NOTHING will show myalert.

Button PB_ENABLE_DISABLE has the following code:
Begin
	If Get_Item_Property('CTRL.PB_NOTHING', ENABLED) = 'TRUE'
	Then
	  Set_Item_Property('CTRL.PB_NOTHING', ENABLED, Property_False);
	  Set_Item_Property('CTRL.PB_ENABLE_DISABLE', LABEL, 'Enable');
	Else
	  Set_Item_Property('CTRL.PB_NOTHING', ENABLED, Property_True);
	  Set_Item_Property('CTRL.PB_ENABLE_DISABLE', LABEL, 'Disable');		
	End If;
End;

Button PB_NOTHING has the following code:
Declare
	pb PLS_INTEGER;
Begin
	pb := Show_Alert('MyAlert');
End;


Granted, quick and dirty but it demonstrates the use.

MHE

[Updated on: Tue, 23 May 2006 02:24]

Report message to a moderator

Previous Topic: how to write IF condition here in cursor
Next Topic: LOV - Multi Column Filtering Option
Goto Forum:
  


Current Time: Fri Sep 20 09:51:19 CDT 2024