定位到月上程序
if key=vk_return then
begin
im
DTP1.SetFocus;移動
SendMessage(DTP1.Handle,WM_KEYDOWN,39,0);time
end;data
定位到日上return
if key=vk_return then
begin
DTP1.SetFocus;
SendMessage(DTP1.Handle,WM_KEYDOWN,39,0);
SendMessage(DTP1.Handle,WM_KEYDOWN,39,0);
end;
DTP1.SetFocus;
SendMessage(DTP1.Handle,WM_KEYDOWN,VK_RIGHT,0); SendMessage(DTP1.Handle,WM_KEYDOWN,VK_RIGHT,0)39是VK_RIGHT的虛擬鍵值。。通用的,就用上面這個,程序容易理解,就是把焦點移動到dataetimepicker上後,模擬光標vk_right被按下。