on 08-23-2009 4:47 PM
I use following code to disable a button on a UDO form, but the status of Enable of that button doesnot change. I still can click on
the button.
oFormIQCQ.Items.Item("btnIQC").Enabled = False
I even tried to add another button and had the similar code to disable it. However I still failed.
But this situation didnot happen on my another UDO forms. Does anyone know what the problem is?
Thanks for your reply.
Hi Chao,
Though your code is correct, there might be few reason why these pesky things happen. Check if any of the following things happen in that form.
1. Make the button disabled in the screen painter itself, and check if it works.
2. See if in any particular event you want to disable the button and check if thats handled properly.
3. If the button is disabled in any particular mode of the form, like say in Find Mode or Add Mode, make it disabled in the Menu Event on the press of 1282 / 1281 and so on...
Hope this helps.
Regards,
Satish. B.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Satish,
Thanks for your reply. What I had done before I post this question includes:
1. Make the button disabled in the screen painter itself, and check if it works.
=> I had tried that, but still failed. No mather I made the button disable or enable in the screen painter, I cannot change its status.
Even, as I mentioned before, to add a new one button in the screen painter doesnot work either.
2. See if in any particular event you want to disable the button and check if thats handled properly.
=> In VS2005 debug mode, I had traced the program by adding breakpoint to every codes that will change the status of the button.
No other codes tried to change the status of button after the code I mentioned.
3. If the button is disabled in any particular mode of the form, like say in Find Mode or Add Mode, make it disabled in the Menu Event on the press of 1282 / 1281 and so on...
=> I will try this.
Hi, Anoop,
The status of buttons can be changed throgh your suggestion. Thanks very much.
But I have some questions about SetAutoManagedAttribute.
1. I use "oitem.SetAutoManagedAttribute" to replace every "oitem.enable = true(or false)" . Is this exactly what you suggest?
Or only need to have some "oitem.SetAutoManagedAttribute" settings after the form is loaded?
2. Could you explain the function of the following code?
oItem.SetAutoManagedAttribute(SAPbouiCOM.BoAutoManagedAttr.ama_Editable, SAPbouiCOM.BoAutoFormMode.afm_All, SAPbouiCOM.BoModeVisualBehavior.mvb_Default)
hi
Since you are using UDO form, you can easily work with this method
This method is using to enable / disable / visible / invisible form items as per the form mode.
That means you can code in Add mode which items should be visible / invisible / enable / disable etc. Like all other modes.
The above code means the Editable property (enable / disable) will be the default for all form modes.
Anoop
User | Count |
---|---|
96 | |
10 | |
9 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.