Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Disable Button in a Datawindow

666 views
Skip to first unread message

Krishnan Shankar

unread,
Mar 9, 2000, 3:00:00 AM3/9/00
to
Is there a way to disable the buttons defined in the datawindow at runtime based
on a condition.

My problem is I have 3 buttons in the Datawindow and I need to disable the same
based on the condtion, I need to do this at runtime,

Object.cb_save.Enabled = False - Does not seem to work? Is there any other way?

Thanks

Shanki
---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp

Jerry Siegel

unread,
Mar 9, 2000, 3:00:00 AM3/9/00
to
DW buttons do not have an Enabled property like command buttons. You need
to set the color [text color] and SuppressEventProcessing properties and
maybe the font.weight to simulate enable/disable.

Look in Help under "attributes of datawindow objects" to find the properties
(and the meaning of their values) for all dw objects.

Krishnan Shankar wrote in message <5KkD3eei$GA...@forums.sybase.com>...

Jim K.

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
I've just simulated this on a recent window with excellent results.

- Change the DW button test color to white.
- Add to the DW button color expression: if(condition,0,16777215)
- Add Text object to the datawindow.
- Change text to be the same as the buttons text and change the color to
gray.
Add a 'ctrl-enter' character in front of the text and change the
alignment to center.
- Add to the Text object visible expression: if(condition,0,1)
- Change the size of the text object to completly cover the DW button
- Position the Text object directly over the DW button to the text from both
objects align, then move the text object 1 up and 1 left. This simulates
the text for a disabled button.

When the condition if true, the text object will be invisible and the DW
button text will be black.
When the condition is not true, the text object will cover the button and
not allow the user to click on it.

HTH
Jim Kruse


"Krishnan Shankar" <Krishna...@netscape.net> wrote in message
news:5KkD3eei$GA...@forums.sybase.com...

Jim K.

unread,
Mar 10, 2000, 3:00:00 AM3/10/00
to
I've just 'simulated' this on my current project and the results are
excellent.

- Change the DW button text color to white. Add to color expression: if
(condition ,0,16777215)
- Add a text object to the datawindow.
- Make the text the same as the button text, with a 'ctrl-enter' character
in front of the text.

0 new messages