Google Групи вече не поддържа нови публикации или абонаменти в Usenet. Съдържанието за минали периоди остава видимо.

DropDown

55 показвания
Преминаване към първото непрочетено съобщение

Claudio

непрочетено,
15.04.2004 г., 21:39:0115.04.04 г.
до
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

непрочетено,
15.04.2004 г., 23:34:4015.04.04 г.
до
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

непрочетено,
15.04.2004 г., 23:57:1615.04.04 г.
до
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

непрочетено,
16.04.2004 г., 0:15:2516.04.04 г.
до
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

непрочетено,
16.04.2004 г., 3:32:4116.04.04 г.
до
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 нови съобщения