473,406 Members | 2,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Forms not responding

Hi there,

When there is a new entry in the event log I will create a new
instance of a form which shows the information in the event log.

However, once the new form is created, my application becomes
unresponsive.

Can anyone help me with it?

Public Overridable Sub NewMessageArrived(ByVal [source] As Object,
ByVal e As EntryWrittenEventArgs)
Dim Entry As EventLogEntry
Dim Result() As String
Entry = e.Entry
Dim TimeStamp As String
Dim MachineName As String
Dim MsgHeader As String

Try
Dim Sender As String
Dim Prefix As String = "Application popup: Messenger
Service : Message from "

If IsNothing(Entry) = True Then
Exit Sub
End If

MachineName = Entry.MachineName
TimeStamp = Entry.TimeWritten
Result = Entry.Message.Split(vbCrLf)
Sender = GetSenderID(Result(0))

MsgHeader = Prefix + Sender + " to " + MachineName + " on
" + TimeStamp + vbCrLf + vbCrLf
Dim str As String
str = Entry.Message.ToString
str = str.Replace(MsgHeader, "")
If ChatInSession(Sender) = False Then

Dim Chat As New frmChat
Me.AddOwnedForm(Chat)

Chat.Text = "Chat window with " + Names
Chat.Tag = UIDs
Chat.Show()
End If

Catch ex As Exception
MsgBox(ex.ToString)
End Try

End Sub

Apr 27 '07 #1
4 971
Chat.ShowDialog()

<ka***********@gmail.comschreef in bericht
news:11**********************@n35g2000prd.googlegr oups.com...
Hi there,

When there is a new entry in the event log I will create a new
instance of a form which shows the information in the event log.

However, once the new form is created, my application becomes
unresponsive.

Can anyone help me with it?

Public Overridable Sub NewMessageArrived(ByVal [source] As Object,
ByVal e As EntryWrittenEventArgs)
Dim Entry As EventLogEntry
Dim Result() As String
Entry = e.Entry
Dim TimeStamp As String
Dim MachineName As String
Dim MsgHeader As String

Try
Dim Sender As String
Dim Prefix As String = "Application popup: Messenger
Service : Message from "

If IsNothing(Entry) = True Then
Exit Sub
End If

MachineName = Entry.MachineName
TimeStamp = Entry.TimeWritten
Result = Entry.Message.Split(vbCrLf)
Sender = GetSenderID(Result(0))

MsgHeader = Prefix + Sender + " to " + MachineName + " on
" + TimeStamp + vbCrLf + vbCrLf
Dim str As String
str = Entry.Message.ToString
str = str.Replace(MsgHeader, "")
If ChatInSession(Sender) = False Then

Dim Chat As New frmChat
Me.AddOwnedForm(Chat)

Chat.Text = "Chat window with " + Names
Chat.Tag = UIDs
Chat.Show()
End If

Catch ex As Exception
MsgBox(ex.ToString)
End Try

End Sub

Apr 27 '07 #2
kah
Hi Cor,

Your suggestions works like a charm. However could you please explain
why using ShowDialog works whereas Show failed?

Thanks and Regards,
Kah
Apr 27 '07 #3
kah
Hi,

Using ShowDialog, I am not able to set focus on the original form. The
only way is to close the new popup. Is there any other way i can go
about doing this?

Thanks and Regards,
Kah Siang

Apr 27 '07 #4
Kah,

Not in an easy way,

Cor

"kah" <ka***********@gmail.comschreef in bericht
news:11**********************@u32g2000prd.googlegr oups.com...
Hi,

Using ShowDialog, I am not able to set focus on the original form. The
only way is to close the new popup. Is there any other way i can go
about doing this?

Thanks and Regards,
Kah Siang

Apr 27 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

65
by: SamMan | last post by:
A question came up at work from one of our clients about forms on their site. The data from these forms are processed by a PHP script and if all goes well, a thank you screen appears. Sometimes,...
6
by: ALthePal | last post by:
Hi, I'm not sure if we are able to or even how to loop through the web forms in a VB.NET project during design time. In MSAccess we are able to go through the database -> forms collection and...
0
by: Tim Haughton | last post by:
I've just released an article on using Test Driven Development with C# and Windows Forms. GUI's are often difficult to test, so I thought it might be of interest. The article along with the...
4
by: Joey Powell | last post by:
Hello all. For a long time now I have been struggling with a .net Windows Forms problem. In several of my applications, I use the "Process" class from System.Diagnostics to accomplish various task...
3
by: Molly J. Fagan | last post by:
Hello-- I'm using forms authentication and have 2 web projects located under the same root directory. In the web.config of the second project, I have <authentication mode="Forms"> <forms...
2
by: gthompson | last post by:
I'm redesigning my Access Form in Visual Studio (asp.net) so that I can have a Web application connected to the Access Database. It is a user form. Is there any way to have a subform in Visual...
14
by: Michael Dunn | last post by:
I am new to VB.NET, have programmed in visual C++ for awhile. My question is whether there is a similar document-view architecture in VB, ie data stored in CDocument, viewed in CView, or is the...
22
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one...
0
by: ssabusivefw | last post by:
I am basically writing a server/client application. The client application starts on the login in form where the user is required to enter a user name and password. These are encrypted sent to the...
5
by: Rory Becker | last post by:
Having now created a Custom MembershipProvider that seems to work correctly with my Logon and ChangePassword controls, I am, as they say, a happy bunny. The next stange is to move on to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.