Google Gruppi non supporta più i nuovi post o le nuove iscrizioni Usenet. I contenuti storici continuano a essere visibili.

DropDown

55 visualizzazioni
Passa al primo messaggio da leggere

Claudio

da leggere,
15 apr 2004, 21:39:0115/04/04
a
I have a form with two buttons (b1 and b2), a datetimepicker and a combobox.
Is there a way to when a press b1 button the datetimepicker drops down, and
whe I press b2 the combobox drops down ?


Praveen Ramesh

da leggere,
15 apr 2004, 23:34:4015/04/04
a
Setting comboBox.DroppedDown to true will let you show the combo's dropdown
programatically. I don't think there is an easy way to do this with the
datetimepicker.

-Praveen
visit www.syncfuison.com for .Net Essentials
http://www.syncfusion.com/faq/winforms/


"Claudio" <news.microsoft.com> wrote in message
news:%23DlsYO1...@TK2MSFTNGP10.phx.gbl...

Tim Wilson

da leggere,
15 apr 2004, 23:57:1615/04/04
a
The DateTimePicker will display it's calendar when it receives an F4
keypress. So you can simulate this by setting focus to the DateTimePicker
and then sending it an F4.

private void button1_Click(object sender, System.EventArgs e)
{
this.dateTimePicker1.Focus();
SendKeys.Send("{F4}");
}

--
Tim Wilson
.Net Compact Framework MVP
{cf147fdf-893d-4a88-b258-22f68a3dbc6a}
"Praveen Ramesh" <rpra...@syncfusion.com> wrote in message
news:%23V6vOP2...@TK2MSFTNGP11.phx.gbl...

Tim Wilson

da leggere,
16 apr 2004, 00:15:2516/04/04
a
I should have pointed out that this is a simple method that will work as
long as the F4 key is not being used as a shortcut to something else, like a
menu item. If this is the case then you could always PInvoke SendMessage and
send the message directly to the control.

using System.Runtime.InteropServices;

private const int WM_KEYDOWN = 0x0100;
private const int VK_F4 = 0x73;

[DllImport("User32.dll")]
private static extern int SendMessage(IntPtr hWnd, int iMsg, int wParam, int
lParam);

private void button1_Click(object sender, System.EventArgs e)
{
this.dateTimePicker1.Focus();

SendMessage(this.dateTimePicker1.Handle, WM_KEYDOWN, VK_F4, 0);
}

--
Tim Wilson
.Net Compact Framework MVP
{cf147fdf-893d-4a88-b258-22f68a3dbc6a}

"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message
news:eLOtUb2I...@TK2MSFTNGP12.phx.gbl...

Claes Bergefall

da leggere,
16 apr 2004, 03:32:4116/04/04
a
Or you can send it an Alt+Down key instead
this.dateTimePicker1.Focus();
SendKeys.Send("%{DOWN}");

/claes


"Tim Wilson" <TIM(UNDERSCORE)WILSON(AT)ROGERS(PERIOD)COM> wrote in message

news:elzGel2I...@TK2MSFTNGP09.phx.gbl...

0 nuovi messaggi