final int[] location = new int[2]; view.getLocationOnScreen(location); final int[] location = new int[2]; view.getLocationOnScreen(location); 这样就可以得到该视图在全局坐标系中的x,y值,(注意这个值是要从屏幕顶端算起,也就是索包括了通知栏的高度)//获取在当前屏幕内的绝对坐标 location[0] x坐标 location[1] y坐标 locatio…
方法一: 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; 方法二:…
一.Js中获取地址栏参数 //从地址栏获取想要的参数 function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } va…