
delphi中怎么设置全程序都是同一个输入法
1个回答
展开全部
先定义一个公共变量 var ImeName : String; 然后在用户登入的时候 选择输入法 procedure TValidateFrm.FormCreate(Sender: TObject); var i: Integer; begin Combobox1.Clear; for i := 0 to Screen.Imes.Count - 1 do//(呵呵,刷出当前计算机的输入法:) begin Combobox1.Items.Add(Screen.Imes[i]); end; Combobox1.Text := Screen.Imes[0]; end; 当用户选择完输入法后,给ImeName付值. PubUnit.ImeName := Combobox1.Text; 然后遍滤 控件 for i := 0 to self.ComponentCount - 1 do begin if Self.Components[i] is TEdit then (Components[i] as TEdit).ImeName := PubUnit.ImeName; if Self.Components[i] is TMemo then (Components[i] as TMemo).ImeName := PubUnit.ImeName; if Self.Components[i] is TDBGrid then (Components[i] as TDBGrid).ImeName := PubUnit.ImeName; end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询