控件获取焦点除了用鼠标外,可以通过键盘来获取,比如Tab键或者方向键等,需要设置控件获取键盘焦点时的样式,可以通过设置FrameworkElemnt.FocusVisualStyle属性, 因为几乎所有常用的控件都继承了FrameworkElement,所以绝大部分控件都拥有该属性 // Summary: // Gets or sets a property that enables customization of appearance, effects, // or other style
方法一: Var I: Integer; Begin For I := To ComponentCount - Do //获取组件数量 Begin If Components[I] Is TWinControl Then Begin If (Components[I] As TWinControl).Focused Then Begin Self.Caption := (Components[I] As TWinControl).Name; Break; End; End; End; 方法二:
1.通过按钮获取单元格所在的值 debugger; var cr; if(window.lineboxes) { var cells = []; for (var i = 0; i < lineboxes.length; i++) { if (lineboxes[i].selected()) { cells[cells.length] = lineboxes[i].options.location; cr=FR.cellStr2ColumnRow(window.lineboxes[i].opti