如何让窗体一打开光标落在TComboBox1里的一个默认字符"光"后,我的窗体类型是fsMDIChild
解决方案 »
- 请问一个 "Invalid Pointer Operation"错误的问题,在窗体关闭时
- stringgrid中如何移动重绘当前单元格
- 想请教如何获得一个JPG图象的大小,从而能动态设置TIMAGE的大小呀???急!
- 关于Listview中multiselect如何显示选择数据的问题???
- Formula中如何通过代码控制打印从第几页到第几页??
- 那里有master/detail的例子下載﹐高分
- 菜問題,我在win2000server+sql2000server寫c/s程序
- 问大家一个数据格式的问题
- 怎样建一个好用的临时表!高分相赠!
- 报表打印使用哪个控件(或解决方安)比较好?请给出个理由?参与者有份!!
- 高手指点:多步操作产生错误。请检查每一步的状态值
- 如何将SQLSERVER中IMAGE字段的内容添加到ACCESS OLE字段中
combobox1.setfocus;
不过要落在字后面,就不知道了。学习ing
我TComboBox1里的TEXT默认值是"光",我想让闪动的光标一打开窗体就落在"光"的后面,而且"光"不是反选状态,可以直接往里输入后面的文字,不知我的表达清楚了没?
begin
ComboBox1.SetFocus;
ComboBox1.SelStart := 2 ;
end;
看看是不是这样子,是就给分,其中ComboBox1.TEXT :='光'
你那种写法我试过,在fsNormal,fsMDIForm类型的窗体中不行,但在fsMDIChild类型的窗体中不行,请问还有别的办法吗?急呀
在下不胜感激~!!~
begin
ComboBox1.SetFocus;
ComboBox1.SelStart := pos('光',ComboBox1.text) ;//参数顺序不记得了
end;
begin
ComboBox1.SetFocus;
ComboBox1.SelStart := pos('光',ComboBox1.text) ;//参数顺序不记得了
Combobox1.SelLength := 0;
end;
Shift: TShiftState);
var str:string;
begin
if combobox1.Focused then
begin
str:=combobox1.text;
combobox1.text:='';
combobox1.text:=str;
ComboBox1.SelStart := pos('光',ComboBox1.text)+2 ;
end;
procedure TForm1.FormPaint(Sender: TObject);
var str:string;
begin
if combobox1.Focused then
begin
str:=combobox1.text;
combobox1.text:='';
combobox1.text:=str;
ComboBox1.SelStart := pos('光',ComboBox1.text)+2 ;
end;
end;
editform:Teditform;
a:boolean;
procedure TEditForm.FormShow(Sender: TObject);
begin
a:=true;
end;
procedure TEditForm.FormPaint(Sender: TObject);
begin
if a then
begin
COMBOBOX1.SetFocus;
cOMBOBOX1.SelStart := 2;
COMBOBOX1.SelLength :=0;
a := false;
end;
end;