本文整理汇总了C#中System.Windows.Forms.PreviewKeyDownEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# PreviewKeyDownEventArgs类的具体用法?C# PreviewKeyDownEventArgs怎么用?C# PreviewKeyDownEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PreviewKeyDownEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了PreviewKeyDownEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: txtModelID_PreviewKeyDown
private void txtModelID_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (string.IsNullOrEmpty(txtModelID.Text))
{
Ultils.TextControlNotNull(txtModelID, "Model");
}
else
{
var model = _modelService.GetModelByName(txtModelID.Text, FujiXerox);
if(model != null)
{
Ultils.SetColorErrorTextControl(txtModelID, "Model này đã được tạo rồi. Vui lòng kiểm tra lại!");
}
else
{
txtQuantity.Focus();
}
}
}
if (e.KeyCode == Keys.Tab)
{
if (string.IsNullOrEmpty(txtModelID.Text))
{
Ultils.TextControlNotNull(txtModelID, "Model");
}
}
}
开发者ID:cuongpv88,项目名称:work,代码行数:30,代码来源:FormAddModel.cs
示例2: CurrentSelected_PreviewKeyDown
private void CurrentSelected_PreviewKeyDown(object TaggerObject, PreviewKeyDownEventArgs e) {
e.IsInputKey = true;
Tagger SelectedObject = (Tagger)TaggerObject, SwappingObject;
int AlphaIndex, BetaIndex;
if (e.KeyCode == Keys.Left) {
AlphaIndex = StringCollection.Controls.GetChildIndex(CurrentSelected);
BetaIndex = AlphaIndex - 1;
if (AlphaIndex > 0) {
SwappingObject = (Tagger)StringCollection.Controls[BetaIndex];
StringCollection.Controls.SetChildIndex(SelectedObject, BetaIndex);
StringCollection.Controls.SetChildIndex(SwappingObject, AlphaIndex);
Tuple<int, string> TempTuple = TagGroupList[AlphaIndex];
TagGroupList[AlphaIndex] = TagGroupList[BetaIndex];
TagGroupList[BetaIndex] = TempTuple;
}
}
if (e.KeyCode == Keys.Right) {
AlphaIndex = StringCollection.Controls.GetChildIndex(CurrentSelected);
BetaIndex = AlphaIndex + 1;
if (AlphaIndex < count - 1) {
SwappingObject = (Tagger)StringCollection.Controls[BetaIndex];
StringCollection.Controls.SetChildIndex(SelectedObject, BetaIndex);
StringCollection.Controls.SetChildIndex(SwappingObject, AlphaIndex);
Tuple<int, string> TempTuple = TagGroupList[AlphaIndex];
TagGroupList[AlphaIndex] = TagGroupList[BetaIndex];
TagGroupList[BetaIndex] = TempTuple;
}
}
CurrentSelected.Focus();
}
开发者ID:divyamamgai,项目名称:FileOrganizer,代码行数:30,代码来源:Match+Case+Dialog.cs
示例3: Form1_PreviewKeyDown
private void Form1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
LoginProccess();
}
}
开发者ID:swoopertr,项目名称:KesSu,代码行数:7,代码来源:Form1.cs
示例4: txtJudge_PreviewKeyDown
private void txtJudge_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (string.IsNullOrEmpty(txtJudge.Text))
{
SetErrorStatus(true, "NG", "Judge không được để trống!");
Ultils.EditTextErrorNoMessage(txtJudge);
}
else
{
if (txtJudge.Text.Trim() == "1" || txtJudge.Text.Trim() == "0")
{
SetErrorStatus(false, null, null);
InsertLog(txtBoxID.Text);
}
else
{
SetErrorStatus(true, "NG", "Judge Error!\nKhông đúng định dạng.\nVui lòng thử lại!\nChỉ chấp nhận giá trị: 1 hoặc 0 ");
txtJudge.SelectAll();
Ultils.EditTextErrorNoMessage(txtJudge);
}
}
}
if (e.KeyCode == Keys.Tab)
{
if (string.IsNullOrEmpty(txtJudge.Text))
{
SetErrorStatus(true, "NG", "Judge không được để trống!");
Ultils.EditTextErrorNoMessage(txtJudge);
}
}
}
开发者ID:cuongpv88,项目名称:work,代码行数:33,代码来源:FormOQCNullModel.cs
示例5: webBrowser_PreviewKeyDown
private void webBrowser_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Back)
{
key = Keys.Back;
}
}
开发者ID:Warrenn,项目名称:WebApp-MultiTenant-OpenIdConnect-DotNet,代码行数:7,代码来源:WindowsFormsWebAuthenticationDialogBase.cs
示例6: GraphicsDeviceControl_PreviewKeyDown
void GraphicsDeviceControl_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Left || e.KeyCode == Keys.Right || e.KeyCode == Keys.Up || e.KeyCode == Keys.Down)
{
e.IsInputKey = true;
}
}
开发者ID:rhynodegreat,项目名称:BulletSharp,代码行数:7,代码来源:GraphicsDeviceControl.cs
示例7: OnAddressEditPreviewKeyDown
private void OnAddressEditPreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
OnGo(EventArgs.Empty);
}
}
开发者ID:xinhuang,项目名称:BrowserApp,代码行数:7,代码来源:AddressBar.cs
示例8: axShockwaveFlash1_PreviewKeyDown
private void axShockwaveFlash1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.Control && e.KeyCode == Keys.V)
{
PlayNewChannel();
}
}
开发者ID:sthakuri,项目名称:YouTubePlayer,代码行数:7,代码来源:uScreen.cs
示例9: txtOperatorCode_PreviewKeyDown
private void txtOperatorCode_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (string.IsNullOrEmpty(txtOperatorCode.Text))
{
Ultils.TextControlNotNull(txtOperatorCode, "Operator code");
}
else
{
gridLookUpEditModelID.Focus();
}
}
if (e.KeyCode == Keys.Tab)
{
if (string.IsNullOrEmpty(txtOperatorCode.Text))
{
Ultils.TextControlNotNull(txtOperatorCode, "Operator code");
}
else
{
gridLookUpEditModelID.Enabled = true;
}
}
}
开发者ID:cuongpv88,项目名称:work,代码行数:25,代码来源:RetailProducts.cs
示例10: txtBoxID_PreviewKeyDown
private void txtBoxID_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Enter || e.KeyCode == Keys.Tab)
{
if (string.IsNullOrEmpty(txtBoxID.Text))
{
SetErrorStatus("NG", "Box ID không được để trống!");
Ultils.EditTextErrorNoMessage(txtBoxID);
}
else
{
string strBoxId = txtBoxID.Text;
if (strBoxId.Length >= 3)
{
if (strBoxId.Substring(0, 3).ToUpper() != "F00")
{
SetErrorStatus("NG", "BOX ID phải bắt đầu bằng F00!");
Ultils.EditTextErrorNoMessage(txtBoxID);
txtBoxID.SelectAll();
}
else
{
txtProductID.Focus();
}
}
else
{
SetErrorStatus("NG", "BOX ID không đúng định đạng!");
Ultils.EditTextErrorNoMessage(txtBoxID);
}
}
}
}
开发者ID:cuongpv88,项目名称:work,代码行数:33,代码来源:FormMain.cs
示例11: axWindowsMediaPlayer1_PreviewKeyDown
private void axWindowsMediaPlayer1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.MediaNextTrack)
{
playnextSong(ind);
}
if (e.KeyCode == Keys.MediaPreviousTrack)
{
if (Shuffle == false)
{
mediaplayer.Ctlcontrols.stop();
if (songListBox.SelectedIndex - 1 < 0)
{
songListBox.SelectedIndex = (int)songListBox.Items.Count - 1;
ind = (int)songListBox.SelectedValue;
}
else
{
songListBox.SelectedIndex = songListBox.SelectedIndex - 1;
ind = (int)songListBox.SelectedValue;
}
playSong(ind);
}
}
}
开发者ID:Ricardo1991,项目名称:osump3,代码行数:28,代码来源:OsuMp3.cs
示例12: MainForm_PreviewKeyDown
private void MainForm_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode.Equals(Keys.Escape)) {
this.Close();
this.Dispose();
}
}
开发者ID:OldyG,项目名称:GoldyCapture,代码行数:7,代码来源:MainForm.cs
示例13: Form1_PreviewKeyDown
private async void Form1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyData == (Keys.Control | Keys.V))
{
var data = Clipboard.GetDataObject();
if (data == null)
return;
if (!data.GetDataPresent(typeof(string)))
return;
var url = (string)data.GetData(typeof(string));
try
{
new Uri(url);
}
catch
{
return;
}
var eater = new Eater();
if (eater.Prepare(url, DataFormats.Html))
{
await eater.Eat(ConfigurationManager.AppSettings["path"]);
MessageBox.Show("Completed!");
}
//foreach (var format in data.GetFormats())
//{
// var content = data.GetData(format);
//}
}
}
开发者ID:john-guo,项目名称:lnE,代码行数:35,代码来源:Form1.cs
示例14: HandlePreviewKeyDown
private void HandlePreviewKeyDown(PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Enter && _tbx_command.Text != string.Empty)
{
DebugManager.SendCommand(_tbx_command.Text);
m_commands.Add(_tbx_command.Text);
if (m_commands.Count > 50)
m_commands.RemoveAt(0);
m_pos = m_commands.Count - 1;
_tbx_command.Text = string.Empty;
}
else if (e.KeyCode == Keys.Down)
{
if (m_commands.Count == 0)
return;
if (m_pos < 0)
m_pos = m_commands.Count - 1;
else if (m_pos >= m_commands.Count)
m_pos = 0;
_tbx_command.Text = m_commands[m_pos--];
}
else if (e.KeyCode == Keys.Up)
{
if (m_commands.Count == 0)
return;
if (m_pos < 0)
m_pos = m_commands.Count - 1;
else if (m_pos >= m_commands.Count)
m_pos = 0;
_tbx_command.Text = m_commands[m_pos++];
}
}
开发者ID:micheleissa,项目名称:dow2-toolbox,代码行数:32,代码来源:DebugWindow.cs
示例15: ClientSetup_PreviewKeyDown
private void ClientSetup_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
this.Close();
}
}
开发者ID:colbybhearn,项目名称:3DPhysics,代码行数:7,代码来源:ClientSetup.cs
示例16: txtOperationID_PreviewKeyDown
private void txtOperationID_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (string.IsNullOrEmpty(txtOperationID.Text))
{
Ultils.TextControlNotNull(txtOperationID, "Operation ID");
}
else
{
btnLogin.Focus();
}
}
if (e.KeyCode == Keys.Tab)
{
if (string.IsNullOrEmpty(txtOperationID.Text))
{
Ultils.TextControlNotNull(txtOperationID, "Line");
}
else
{
btnLogin.Focus();
}
}
}
开发者ID:cuongpv88,项目名称:work,代码行数:25,代码来源:FormQALogin.cs
示例17: SecondTypeControls
private static void SecondTypeControls(IPlayer player, PreviewKeyDownEventArgs e)
{
if (player == null)
{
return;
}
switch (e.KeyData)
{
case Keys.W:
player.Car.MoveUp();
break;
case Keys.A:
player.Car.MoveLeft();
break;
case Keys.D:
player.Car.MoveRight();
break;
case Keys.S:
player.Car.MoveDown();
break;
default:
return;
}
Ui.Instance().RequireScreenUpdate();
}
开发者ID:tautvisv,项目名称:NFS3000,代码行数:25,代码来源:MainForm.cs
示例18: txtProductionId_PreviewKeyDown
private void txtProductionId_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (string.IsNullOrEmpty(txtProductionId.Text))
{
Ultils.TextControlNotNull(txtProductionId, "The Production ID required.");
}
else
{
var production = _oqcService.GetLogByProductionId(txtProductionId.Text);
if (production != null)
{
txtBoxId.Focus();
}
else
{
Ultils.EditTextErrorMessage(txtProductionId, "The Production ID not exits.");
}
}
}
if (e.KeyCode == Keys.Tab)
{
if (string.IsNullOrEmpty(txtProductionId.Text))
{
Ultils.TextControlNotNull(txtProductionId, "The Production ID required.");
}
}
}
开发者ID:cuongpv88,项目名称:work,代码行数:29,代码来源:FormAction.cs
示例19: maskedTextBoxNetworkIP_PreviewKeyDown
private void maskedTextBoxNetworkIP_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
// MessageBox.Show("KeyDown");
if (e.KeyCode == Keys.Tab)
{
int pos = maskedTextBoxNetworkIP.SelectionStart;
int max = (maskedTextBoxNetworkIP.MaskedTextProvider.Length - maskedTextBoxNetworkIP.MaskedTextProvider.EditPositionCount);
int nextField = 0;
//MessageBox.Show(pos.ToString() + "" + max.ToString());
for (int i = 0; i < maskedTextBoxNetworkIP.MaskedTextProvider.Length; i++)
{
if (!maskedTextBoxNetworkIP.MaskedTextProvider.IsEditPosition(i) && (pos + max) >= i)
nextField = i;
}
nextField += 1;
// We're done, enable the TabStop property again
if (pos == nextField)
maskedTextBoxNetworkIP_Leave(this, e);
maskedTextBoxNetworkIP.SelectionStart = nextField;
}
}
开发者ID:yanceyb,项目名称:YanceySubnetCalculator,代码行数:25,代码来源:Form1.cs
示例20: pictureBox2_PreviewKeyDown
private void pictureBox2_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Escape)
{
profSelected = 0;
}
}
开发者ID:usamedin,项目名称:VP-Game-Exams,代码行数:7,代码来源:Play.cs
注:本文中的System.Windows.Forms.PreviewKeyDownEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论