篆体字网 > 知识库

htmlbutton

来源:篆体字网 2023-12-28 13:41:01 作者:篆字君

1 ///


2 /// 将Html元素转换为控件实体
3 ///

4 ///当前选择的Html元素
5 ///
6 public IControl GetControl(IHTMLElement htmlControl)
7 {
8 if (htmlControl == null) return null;
9 if (!(htmlControl is HTMLButtonElement))
10 return null;
11
12 _htmlButton = htmlControl as HTMLButtonElement;
13 this._htmlControl = htmlControl;
14
15 if (this._button == null) this._button = new WebFormDesigner.ControlOperation.PropertySort.Button();
16
17 //将Html元素属性值设置到控件实体属性
18 if (this._htmlButton.id != null && this._htmlButton.id.Trim() != "")
19 {
20 this._button.Id = this._htmlButton.id;
21 this._button.Name = this._htmlButton.id;
22 }
23 if (this._htmlButton.title != null && this._htmlButton.title.Trim() != "")
24 this._button.Title = this._htmlButton.title;
25 if (this._htmlButton.value != null && this._htmlButton.value.Trim() != "")
26 this._button.Value = this._htmlButton.value;// this._htmlControl.getAttribute("value", 0) as string;
27 if (this._htmlButton.getAttribute("buttontype", 0) != null && this._htmlButton.getAttribute("buttontype", 0).ToString() != "")
28 this._button.ButtonType = this._htmlButton.getAttribute("buttontype", 0).ToString();
29 else
30 this._htmlButton.removeAttribute("buttontype", 0);
31 this._button.ToDataEx = WebFormDesigner.ControlOperation.Evaluate.Parameters.ConvertFormString(this._htmlButton.getAttribute("todataex", 0) as string);
32 if (this._htmlButton.accessKey != null && this._htmlButton.accessKey.Trim() != "")
33 this._button.AccessKey = this._htmlButton.accessKey;//.getAttribute("accesskey", 1) as string;
34 if (this._htmlButton.tabIndex != 0)
35 this._button.TabIndex = this._htmlButton.tabIndex;//Int32.Parse(.getAttribute("tabindex", 0).ToString());
36 if (this._htmlButton.className != null && this._htmlButton.className.Trim() != "")
37 this._button.Class = this._htmlButton.className;
38 this._button.Style = new CustomStyle(this._htmlButton.style);
39 return this._button;
40 }

上一篇:google android sdk

下一篇:k366算命网

相关阅读