Link to home
Start Free TrialLog in
Avatar of Rah082800
Rah082800

asked on

Enable/Disable buttons on datawindow.

I want to set a datawindow to read only yet keep the buttons that are on that datawindow enabled.  When you set the datawindow to read only it appears to disable all events associated with that datawindow.  Short of moving the buttons to the window and doing quite a bit of coding, I wonder if there is an easier way.
ASKER CERTIFIED SOLUTION
Avatar of Bhatti
Bhatti

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bhatti
Bhatti

Hi,

Me again.

If your datawindow is read only parmanently, then set the taborder to 0 for all columns. In datawindow painter menu Design--> taborders.

Thanks.

Bhatti
Hallo Rah,

I checked and did not find any function or property that can disable the datawindow button. There may exist some trick, but I did not find.

I am looking for how to disable a button(datawindow control) in datawindow.


Bhatti
Hi Rah,

You can also use an datawindow expression to check if the DW is readonly and if it is, just make the button invisible.

If you paste this expression in the button's 'Visible' expression editor it might do the trick:

if (describe("DataWindow.ReadOnly") = "yes", 0, 1)

Cheers,
Alex
oops! clicked the Answer radiobutton. I'm sorry: it was meant as a comment.
Hallo Rah,

May be some trick exist to Enable/Disable the button control of Datawindow, But I find no properties for the Button control of Datawindow. There may we can adjust through the "SuppressEventProcessing" property.
Can you please let me know which action you want to Enabled and which disable.


THANKS


Bhatti
Avatar of Rah082800

ASKER

Trouble responding to comments.  This solution works and is in fact the way I had already solved the problem.  I was wondering if anyone knew of another method, however, it seems that this is the only solution.
To Alex, I want the buttons to be visible and useable all the time even if the datawindow is set to readonly.
Hallo Rah,

Again me, I have another solution, I found it just few days before. Do the following,

(Just make your datawindow button unvisible)
Place your datawindowcontrol  in the Window and select datawindow for the datawindowcontrol.
Now select a Button control from the window controls and place it to the window.
Now move the button with the help of mouse to the place in datawindow where you want to place it.
In this window button control write your script for you datawindow.

If you will write dw_1.Enabled = FALSE your Button will always Enable.

Try it and let me know please.

Thanks.

Bhatti