fieldset{padding:10px;}
如何取得当前焦点控件数组的最大下标UBound(Me.ActiveControl)提示“缺少数组”Me.ActiveControl.UBound提示“对象不支持该属性或方法”——最佳解决方案——————————————————–枚举。——其他解决方案——————————————————–PrivateFunctionGetActiveCtrlUbound()AsIntegerDimxAsVB.ControlDimMaxIndexAsIntegerForEachxInMe.ControlsIfVBA.VarType(VBA.CallByName(Me,x.Name,VbGet))=vbObjectThen’控件数组Ifx.Name=Me.ActiveControl.NameThenIfMaxIndex<x.IndexThenMaxIndex=x.IndexEndIfEndIfNextGetActiveCtrlUbound=MaxIndexEndFunction——其他解决方案——————————————————–
顶哦——其他解决方案——————————————————–
谢谢,虽然ForEach比较耗资源,但好像也没更好的办法了。当你能爱的时候就不要放弃爱