Jim
|
|
1 | |
PopupMenu не отображается в модальной форме.07.09.2009, 14:50. Показов 1498. Ответов 2
Метки нет (Все метки)
Столкнулся с такой проблемой PopupMenu не отображается в
модальной форме. У меня на форме есть контрол и у контрола PopupMenu. Если форма немодальная UserControl.PopupMenu miPopup работает чудесно. Если же она модальная не работает. Не отображается и все тут. Кто знает напишите буду признателен. |
07.09.2009, 14:50 | |
Ответы с готовыми решениями:
2
Сохранение параметров в модальной форме Передать форме открытие модальной формы Динамическое создание компонентов на модальной форме Drag&Drop в модальной форме |
Vita
|
|
07.09.2009, 18:12 | 2 |
Не используй модальность. Немного кода и модальность исчезает, хотя может это-то тебе и не нужно. Но все же:
Код
Private Sub Form_Click() Form2.Show vbModal End Sub Код
Private WithEvents frm2 As Form Private Sub Form_Click() Set frm2 = Form2 frm2.Show vbModeless End Sub Private Sub frm2_Load() Me.Enabled = False End Sub Private Sub frm2_Unload(Cancel As Integer) Set frm2 = Nothing Me.Enabled = True End Sub |
Jim
|
|
08.09.2009, 12:51 | 3 |
Все оказалось очень просто нашел в MSDN.
Вот эта статья. SYMPTOMS If an application contains at least two forms and one of those forms is displayed modally by using a PopupMenu on another form, a PopupMenu on the modal form will not be displayed. RESOLUTION A Timer control can be used to work around this problem: Start a new Standard EXE project. Form1 is added by default. Add a Timer control (Timer1) to Form1. Add another form (Form2) to the project. On Form1, create a menu (mnuFile) with a caption of 'File' that has a submenu (mnuOpen) with a caption of 'Open.' On Form2, create a menu (mnuEdit) with a caption of 'Edit' that has a submenu (mnuFind) with a caption of 'Find.' Add the following code to the General Declarations section of Form1: Private Sub Form_Load() Timer1.Enabled = False Timer1.Interval = 1 End Sub Private Sub Form_Click() PopupMenu mnuFile End Sub Private Sub Timer1_Timer() Form2.Show 1 Timer1.Enabled = False End Sub Private Sub mnuOpen_Click() Timer1.Enabled = True End Sub Add the following code to the General Declarations section of Form2: Private Sub Form_Click() PopupMenu mnuEdit End Sub Press the F5 key to run the program. Click on Form1 and the Open PopupMenu will be displayed. Click on the Open PopupMenu and Form2 is shown modally. Click on Form2 and the Edit PopupMenu is displayed. |
08.09.2009, 12:51 | |
08.09.2009, 12:51 | |
Помогаю со студенческими работами здесь
3
Убрать системный звук при модальной форме Обновление данных DataSource в DataGridView в модальной форме При работающей модальной форме из нее показать модальную форму Хотел на модальной форме для кнопки сделать hotkeys, но вылетает ошибка. Искать еще темы с ответами Или воспользуйтесь поиском по форуму: |