WindowsフォームアプリケーションのUIコントロールが必要です。そのようなUIの名前はわかりませんが、必要なものを説明できます。フォームにマウスを置くと、フォームの横にあるCONTROLが開くボタンをフォームに配置できます。アニメーションで、そのコントロールにいくつかのボタンを追加したいと思います。そのコントロールは何ですか?RADコントロールに使用できるそのようなコントロールはありますか?本当にありがとうございました。
1 に答える
1
必要なのはForm
、カスタマイズを加えた別の方法です(おそらく、上部のコントロールボックスを削除します。たとえば、閉じる、最大化、最小化するなど)。そして、ボタンMouseHover
イベントでこのフォームを開くことができます。何かのようなもの:
private void MyButton_MouseHover(object sender, EventArgs e)
{
//Assume that you made this form in designer
var cutomForm = new CustomForm();
//Set the opening location somewhere on the right side of main form, you can change it ofc
cutomForm.Location = new Point(this.Location.X + this.Width, this.Height / 2);
//Probably topmost is needed
cutromForm.TopMust = true;
customForm.Show();
}
アニメーションについては、グーグルでwinformwsのアニメーションを検索できます。または、WinFormsアニメーションのように、あちこちを見てください。
他の質問について
新しく開いたフォームを移動に合わせて移動する場合は、いくつかの変更が必要です。まず、コードのフィールドとして新しいフォームを用意する必要があります(次に、ボタンのホバーも変更する必要があります)。
private CustomForm _customForm;
private void MyButton_MouseHover(object sender, EventArgs e)
{
//Check if customForm was perviously opened or not
if(_customForm != null)
return;
//Assume that you made this form in designer
_customForm= new CustomForm();
//Set the opening location somewhere on the right side of main form, you can change it ofc
_customForm.Location = new Point(this.Location.X + this.Width, this.Height / 2);
//Probably topmost is needed
_customForm.TopMust = true;
//Delegate to make form null on close
_customForm.FormClosed += delegate { _customForm = null;};
_customForm.Show();
}
Move
両方のフォームを一緒に動かし続けるには、メインフォームの場合に次のように処理する必要があります。
private void Form1_Move(object sender, EventArgs e)
{
if(_customForm != null)
{
//Not sure if this gonna work as you want but you got the idea I guess
_customForm.Location = new Point(this.Location.X + this.Width, this.Height / 2);
}
}
于 2012-09-04T06:14:12.383 に答える