|
GIP 5 / 5 / 0 Регистрация: 07.04.2010 Сообщений: 273 |
||||||||
|
1 |
||||||||
|
03.01.2017, 10:48. Показов 1133. Ответов 5 Метки нет (Все метки)
Кто может подсказать почему может не отображаться на экране сообщение :
ситуация следующая : одна форма меняет содержимое текстового поля на другой форме,
далее еще несколько, в одной из которых срабатывает команда сообщения, появляется звуковой сигнал при выполнении команды показать сообщение, но само сообщение никак невозможно увидеть !!!! и прога дальше не двигается, т.к. пользователь не может нажать ОК !. На VB6 таких проблем не было, здесь проблемы….
__________________
0 |
|
Programming Эксперт 94731 / 64177 / 26122 Регистрация: 12.04.2006 Сообщений: 116,782 |
03.01.2017, 10:48 |
|
5 |
|
1072 / 805 / 143 Регистрация: 25.07.2015 Сообщений: 1,772 |
|
|
03.01.2017, 12:11 |
2 |
|
Всё срабатывает. Миниатюры
0 |
|
5 / 5 / 0 Регистрация: 07.04.2010 Сообщений: 273 |
|
|
03.01.2017, 12:14 [ТС] |
3 |
|
не срабатывало именно у меня….я решил вопрос следующим образом,
0 |
|
22 / 22 / 7 Регистрация: 26.05.2011 Сообщений: 256 |
|
|
10.01.2017, 02:04 |
4 |
|
GIP, MsgBox не работает, если его вызывать не из основного потока приложения. Это уж точно, но возможно суть еще в классах из под которых он вызывается. Разные формы – разные классы. У Вас, как я догадываюсь, msgbox вызывается не из той формы, которая конкретно сейчас выполняет какое-то действие (иначе бы все работало), а оно вызывается формой, которая сейчас как бы в стороне и срабатывает лишь событие.
2 |
|
5 / 5 / 0 Регистрация: 07.04.2010 Сообщений: 273 |
|
|
10.01.2017, 17:45 [ТС] |
5 |
|
Stass48, спасибо за ответ.
0 |
|
117 / 110 / 31 Регистрация: 05.04.2014 Сообщений: 224 |
|
|
11.01.2017, 20:16 |
6 |
|
Еще можно предположить, что форма, которая вызывает MsgBox из другой формы является модальной.
1 |
- Remove From My Forums
-
Question
-
I have a problem in VB.Net with the msgbox function. When it runs, it does not always display. Sometimes it just pops onto the taskbar, but and I have to click it to get it to display. The msgbox is coded as follows:
Dim Reply As Integer
Dim style As MsgBoxStyle
style = MsgBoxStyle.YesNo Or MsgBoxStyle.Question Or MsgBoxStyle.DefaultButton2
Reply = MsgBox(«You have made changes to this record, do want to save them?», style, «Cancel»)If Reply = vbYes Then
SaveRecord()
End IfThis is a Web based project
Answers
-
Bill
I know you can put the msgbox in and it will display a messagebox but what was being said was that this will not occur on the client machine but on the server. So what will happen is that you application will halt until someone on the server machine clicks the msgbox.
This may not be an issue when you developing and you Server and Development Machine/Client are the same but when you deploy on IIS — it will be a problem as the msgbox wont occur on the client machine viewing you web page — it will occur on the IIS machine.
This is why using msgbox wont work. But there is nothing to stop you physically using it.
Почему у меня не выводит элемент MsgBox(), ошибок не выдаёт во время компиляции, но при нажатии кнопки ничего не происходит. Также пробовал без объявления «msg» и присваивания, тоже ничего не получилось.
Почему этот элемент не корректно работает?
Private Sub CommandButton1_Click()
'Dim i, s, m As Integer
Dim msg As Boolean
'm = Val(TextBox1.Text)
'Dim N(m) As Integer
's = 0
msg = MsgBox("Текст содержащий вопрос", vbYesNo, "Диалоговоя форма")
'For i = 1 To m
'ListBox1.Items.Add(Str(i))
'N(i) = i
's = +N(i)
'Next
'ListBox1.Items.Add("S = " + Str(s))
End Sub
![]()
0xdb
51.2k194 золотых знака56 серебряных знаков226 бронзовых знаков
задан 7 мая 2018 в 4:07
4
Во-первых MsgBox возвращает число но не Boolean.
Попробуйте так, взято из рабочей проги:
If MsgBox("Do you want to enter a new patient?", vbYesNo) = MsgBoxResult.No Then
' do something
End If
ответ дан 7 мая 2018 в 13:54
![]()
arifarif
1597 бронзовых знаков
I am getting an error while using msgbox command in visual basic .net in visual studio 2019 community version .
The error is saying that msgbox is not declared or it is inaccessible due to its protection level.
Please help me to correct this error.
I have downloaded all the required libraries for visual basics.
![]()
braX
11.4k5 gold badges20 silver badges33 bronze badges
asked Sep 5, 2021 at 4:02
2
It sounds like you’re missing an Imports at the top of the file. Likely you want:
Imports System.Windows.Forms
Alternatively, your project might not be referencing the right assemblies for the MessageBox type to be found.
Can you share the contents of your source code and project file, by editing your question to include more details?
answered Sep 6, 2021 at 3:53
Drew NoakesDrew Noakes
294k162 gold badges669 silver badges736 bronze badges
1
I am getting an error while using msgbox command in visual basic .net in visual studio 2019 community version .
The error is saying that msgbox is not declared or it is inaccessible due to its protection level.
Please help me to correct this error.
I have downloaded all the required libraries for visual basics.
![]()
braX
11.4k5 gold badges20 silver badges33 bronze badges
asked Sep 5, 2021 at 4:02
2
It sounds like you’re missing an Imports at the top of the file. Likely you want:
Imports System.Windows.Forms
Alternatively, your project might not be referencing the right assemblies for the MessageBox type to be found.
Can you share the contents of your source code and project file, by editing your question to include more details?
answered Sep 6, 2021 at 3:53
Drew NoakesDrew Noakes
294k162 gold badges669 silver badges736 bronze badges
1
- Remove From My Forums
-
Question
-
User858780068 posted
i have developed an asp.net application with vb.net code behind. In that i have used message box when the user selects submit button before selecting the value in dropdownlist.
It is giving me the error
«Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.»
please give me the solution
Answers
-
User945078486 posted
hi,
You can’t use MsgBox in ASP.net. The code is executing on the server. Even if you could use msgbox, when a page request generated a message box, it would pop up on the server not the client’s
machine. you said your MsgBox worked partly coz that your client and your web server are running on the same computer. if you use another client computer to access the page, the MsgBox won’t work.If you want to generate a client-side message box you need to use a javascript alert.
-
Marked as answer by
Thursday, October 7, 2021 12:00 AM
-
Marked as answer by
- Remove From My Forums
-
Question
-
User858780068 posted
i have developed an asp.net application with vb.net code behind. In that i have used message box when the user selects submit button before selecting the value in dropdownlist.
It is giving me the error
«Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.»
please give me the solution
Answers
-
User945078486 posted
hi,
You can’t use MsgBox in ASP.net. The code is executing on the server. Even if you could use msgbox, when a page request generated a message box, it would pop up on the server not the client’s
machine. you said your MsgBox worked partly coz that your client and your web server are running on the same computer. if you use another client computer to access the page, the MsgBox won’t work.If you want to generate a client-side message box you need to use a javascript alert.
-
Marked as answer by
Thursday, October 7, 2021 12:00 AM
-
Marked as answer by
|
|






