sadier

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
        private void EnableForm(bool isReadOnly)
        
{
            
bool isEndble = !isReadOnly;
            Control ctl 
= txtProposer.Parent;
            
foreach(Control sonctl in ctl.Controls)
            
{
                
if (sonctl is TextBox)
                
{
                    ((TextBox)sonctl).Attributes[
"readOnly"= isReadOnly.ToString();
                }


                
if (sonctl is HtmlInputText)
                
{
                    ((HtmlInputText)sonctl).Attributes[
"readOnly"= isReadOnly.ToString();
                }


                
if (sonctl is RadioButtonList)
                
{
                    ((RadioButtonList)sonctl).Enabled 
= isEndble;
                }


                
if (sonctl is DropDownList)
                
{
                    ((DropDownList)sonctl).Enabled 
= isEndble;
                }

            }

        }
posted on 2005-07-29 13:19  毛小华  阅读(982)  评论(2编辑  收藏  举报