小编Var*_*mar的帖子

在<SELECT>中选择动态默认值

我有一个更新用户信息的PHP脚本.我创建了一个html表单,允许用户编辑值并输入新值.现在,当第一次加载表单时,它会显示一些从php变量中获取的默认值.工作正常,但问题是标签.

<input type = "text" name = "name" class = "text" value = "<?php echo $user->name; ?>" />
Run Code Online (Sandbox Code Playgroud)

这很好..

<select name = "department" value = "<?php echo $user->department; ?>">
    <option>Information Technology</option>
    <option>Computer Science</option>
    <option>Electronics & Communication</option>
    <option>Mechanical Engineering</option>
    <option>Civil Engineering</option>
    <option>Electrical & Electronics Engineering</option>
    <option>M.Tech</option>
    <option>MBA</option>
    <option>MCA</option>
</select>
Run Code Online (Sandbox Code Playgroud)

我该如何解决这个问题?

html php

1
推荐指数
1
解决办法
2万
查看次数

Form1_KeyDown不工作

private void Form1_KeyDown(object sender, KeyEventArgs e)
{
    if (listBox1.Items.Contains(e.KeyCode))
    {
        listBox1.Items.Remove(e.KeyCode);
        listBox1.Refresh();
        timer1.Interval -= 10;
        difficultyProgessbar.Value = 800 - timer1.Interval;
        stats.update(true);
    }
    else
    {
        stats.update(false);
    }

    correctLabel.Text = stats.correct.ToString();
    missedLabel.Text = stats.missed.ToString();
    totalLabel.Text = stats.total.ToString();
    accuracyLabel.Text = stats.accuracy.ToString();

}

private void timer1_Tick(object sender, EventArgs e)
{
    //Add a random key to Listbox
    listBox1.Items.Add((Keys)random.Next(65, 90));
    Application.DoEvents();
    if (listBox1.Items.Count > 7)
    {
        listBox1.Items.Clear();
        listBox1.Items.Add("Game Over");
        timer1.Stop();
    }
}
Run Code Online (Sandbox Code Playgroud)

当我运行我的应用程序时,timer1_Tick事件工作正常,但是Form1_KeyDown当我按任意键时事件不会执行.缺少什么?为什么Key_Down事件永远不会发生?谢谢

c# winforms

1
推荐指数
1
解决办法
2613
查看次数

标签 统计

c# ×1

html ×1

php ×1

winforms ×1