|
I am creating an application that will create a notify window similar to outlook 2003 notify popup. I am making an asyncronous remoting call using system.thread that raises an event to show the form. However, the form shows up as a black box and then immediately disappears when the event is called. If I call the function through a menu item or button, it works fine.
Here's the popup code:
Private Sub ATU_RetrieveDone(ByVal e As AsyncUpdater.AsyncUpdaterEventArgs) Handles ATU.RetrieveDone
Me.UpdateTimer.Enabled = False
If e.Forums Is Nothing Then
UpdateTopicListView(e.Results) ' Updates a list view and
' displays the popup.
Else
UpdateForumListView(e.Forums)
End If
Me.UpdateTimer.Enabled = True
End Sub
Private Sub UpdateTopicListView(ByVal Topics As ResultsCollection)
For index As Integer = 0 To Topics.Count - 1
...
Next
Dim Message As String
Message = "{0} new topic updates have been retrieved from {1}"
Me.ShowPopup(String.Format(Message, Topics.Count, ClientSettings.WebURL))
End Sub
Private Sub ShowPopup(ByVal Message As String, Optional ByVal TimeOut As Integer = 0)
Dim displaytime As Integer
If TimeOut < 1000 Then
displaytime = ClientSettings.PopupTime * 1000
Else
displaytime = TimeOut
End If
Dim PW As New PopupWindow
PW.SetProperties(NewMessagePopup.Blend, Message, displaytime)
PW.ShowPopup()
End Sub
And here's routine that creates the popup using a seperate windows form.
Public Sub ShowPopup()
Dim tbl As TaskBarLocation
Dim workingArea As Rectangle
Dim pt As Point
pt = New Point
pt.X = 0 : pt.Y = 0
workingArea = SystemInformation.WorkingArea
tbl = GetTaskBarLocation() ' Gets an enumerator
' indicating the windows task bar
' location.
Select Case tbl
Case TaskBarLocation.Bottom
pt.X = workingArea.Right - Me.Width
pt.Y = workingArea.Bottom - Me.Height
Case TaskBarLocation.Left
pt.X = workingArea.Left
pt.Y = workingArea.Bottom - Me.Height
Case TaskBarLocation.Right
pt.X = workingArea.Right - Me.Width
pt.Y = workingArea.Bottom - Me.Height
Case TaskBarLocation.Top
pt.X = workingArea.Right - Me.Width
pt.Y = workingArea.Top
End Select
Me.Visible = False
Me.Show()
Me.Top = pt.Y
Me.Left = pt.X
Me.Visible = True
tmrStartFade.Enabled = True ' Wait until elapsed to begin form fadeout
End Sub
Any ideas why this might be occuring?
Thanks!
|
|
|
|
|
I guess the problem is because you're calling methods/setting properties on the control from another thread. You should use BeginInvoke or Invoke methods on the UI (the Form object in your case) to marshal the call to the UI thread.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
When we make some software protection (using HD serial number for example) we have the Reflector problem.
That mean we could go back from the DOtNet exe to the source code. so any Idea ?
Thanks
|
|
|
|
|
Obfuscate the Sourcecode, encrypt strings.
|
|
|
|
|
Hello,
There are a few companies out there saying that even though you have an outbound only firewall they are able to create a two way, bidirectional communication with client and server.
how is this possible without the client being a simple 'Get' client with two channels open, one for get and another for set but both pulling data from server. The server doesnt push to client.
Anyone know?
Steve
|
|
|
|
|
It usually works like this:
Firewalls block connections that are being made from the "outside" world. In order to allow easy configuration, you can specify a set of ports on which clients may connect to an outside server. As this usually means "TCP/IP" connection, a second "channel" is necessary, which ends on some random port (>1024) at the client.
(eg. client(192.168.0.1) connects to server(192.168.0.250) on port 80-> client sends to 192.168.0.250:80 and received on 192.168.0.1:1234)
The firewall "knows" that the outgoing connection is OK, so the incoming connection has to be accepted as well, since its necessary for the TCP Connection.
There are quite a few other tipps and tricks (one involving automatic changes to your firewall software), but this is whats commonly done.
For more information, see "PASV" FTP-command.
Cheers
Sebs
|
|
|
|
|
Good day all,
I am trying to gather some information about the Caching Application Block and finding it a bit hard to find documentation on it. I have read some nice write ups of its use on different sites, but I am really looking for people's opinions on whether this App Block is worth the time to implement or if you are better off with a custom solution? Especially after diving into the UIP app block recently and hearing discussions of its bloat and problems.
Our project consists of a web client and a smart client and there has been discussion amongst our team of putting parts in multiple app domains. If I am understanding it right, we would need a seperate instance of the block for each app domain? Has this proved to be transparent or a problem for people on larger scale applications? We are also going to be moving at a pretty rapid pace during development so we need to keep speedbumps down to a minimum.
I would appreciate hearing people's thoughts and experience with this application block!
Thanks in Advance,
Jeremy Dean
|
|
|
|
|
Hi,
I read an article on your web site "Five reasons for using an O/R mapping tool". Ya that person is right, I also dont know about O/R mapping. But when I download and try TierDeveloper I am impress, because it generate code for me in C# and VB.Net both. I also suggest all of you to try it atleast once.
http://www.alachisoft.com/download.htm
|
|
|
|
|
I have made a small windows service and I want a system tray icon I can use to interact with the service. I Suspect I'll need to create a separate application that controls the icon and monitors the service. My question is, how do I only have the application running when the service is running? Obviously the application would only run when a user is logged in, but can someone point me in the right direction, or possibly to an article that can help me solve this problem?
NATHAN RIDLEY
Web Application Developer
email: nathan @ netlab.com.au
[remove the spaces before and after the @ symbol]
|
|
|
|
|
Are you just looking to start and stop the service form your system tray app or do you want to interract at a higher level (config parms, etc)?
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
Hi
I have a problem, in my application I have a window with a lot of labels(50-100) in it. So far so good but the performance is horrible when the labels has to redraw. What do I need to do? Suppress the redraw some how, bypass the normal OnPaint or what? Also I would like to know why this happens, is this a common problems with labels or is there something I might have done wrong in the data binding maybe?
/Regards Johan Hertz
|
|
|
|
|
It depends on what you are trying to achieve with your app.
If its a representation of a plant or installation, you will have to update only the labels which have changed (by comparison).
If you are resizing your form often, you should only draw the labels when the resizing is done (on completion).
If you just want to change labels time-dependant, you should use a timer which ticks every so often and updates one set of labels. (by timer)
If you have other windows which are drawn on top of your app, you should only redraw the changed region (by screen-region)
The problem is, that Windows is responsible for telling applications to redraw. Windows passes along some information, including the exact screen area which needs to be redrawn. If you dont take this into consideration, you will end up redrawing the whole windows every time a message-box pops up.
Updating controls has a HUGE overhead associated with it. You should try to update the labels rarely. Say, you are doing some computations and are updating the label continously. Bad idea. Instead, you should use a seperate thread to compute the results and update the label afterwards. That way, your form will still respond to size- and position-changes - and, since the labels have not been updated, Windows can simply move the graphic representation of your window without having to redraw every time.
Cheers
Sid
|
|
|
|
|
Ok
Thanks for the reply, I don't need to update my labels often at all, what I would like to do is to redraw them when the resizing is done, what I have done so far is to completely remove all labels while resizing and then draw them back on onces the redraw have finished. This is poor for feed back but works. Is there a way in which I can keep the labels on the form but not update them? Any way thanks for the help so far.
/Regards Johan
|
|
|
|
|
Hello, can anybody help me?
I've got this strange problem. In my desktop application, I have a picturebox. Normally this picturebox has the border set to 'none'. When the user comes close to a border (marging 2 px), I change the cursor to any of the resize options available. No problem so far, but... I want to resize the picture box when the mouse is moved. Again, not really a problem except for the following... When the user clicks the box (while the cursor is in a resize mode), I set the border.FixedSingle... The resizing is not the issue, but somehow when the mouse pointer is exactly over the border (that one little pixel), the cursor changes to 'default'. I'm not doing it with coding... As soon as the user moves of the border, the cursor is correct again.
Although this is purely a 'visible' problem, and it terribly ugly... The real problem is deeper. When the cursor is any of the resize cursors, my programming works fine. When the mouse button is released, the picturebox is resized and everything is okay, but... During that one moment when the cursor is set to default (aka, when the mouse is precisely on the border), the mouse up function I've created isn't fired.
I really have no clue what's going on... Can't seem to detect the 'sender' either...
Anybody? Were can I look??
Thanks in advance.
Masaia
|
|
|
|
|
Maybe u can set the cursor of the closer 2 pixs of the image to the resize cursor?
|
|
|
|
|
i think that when you hover over the border the cursor changes because thats a so-called non-client area, which means its painted by the operating system
so you cant paint there, and there are also no mouse events fired
this sucks big time, believe me!
|
|
|
|
|
BinaryWriter/Reader documentation indicates it
"writes in little-endian".
My question: Is the documentation correct? Did it mean to say
"BinaryWriter/Reader is (guaranteed for all time) to write/read in little-endian".
OR
"If System.BitConverter.IsLittleEndian is TRUE,
THEN BinaryWriter/Reader will write/read in little-endian".
ELSE BinaryWriter/Reader will write/read in big-endian
|
|
|
|
|
"BinaryWriter/Reader is (At this time) to write/read in little-endian".
|
|
|
|
|
I have two separate Forms executables that interact and behave visually to the user as one application. When my second app starts I set it's form to TopMost to ensure the user can see it above the first app so it appears like a child of the first. Of course this is not really what I want because now it is above all windows.
Is there a way to establish a parent-child Form relationship between Forms in separate applications?
Thanks.
|
|
|
|
|
bherman69 wrote:
Is there a way to establish a parent-child Form relationship between Forms in separate applications?
No, there isn't.
Why are they seperate app's? If they are so interrelated, why not combine them into one application? If they were in the same application, then you could use ShowDialog to show the second form as an Application Modal Dialog, instead of the mess you created.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Believe me, I wish they could be in the same application. But they can't so I am left with trying to solve the issue of Form relationships between applications.
Thanks.
|
|
|
|
|
is there is bulid in support in windowsXP for the .netframework.
ddd
|
|
|
|
|
No, you have to install it. I think Windows Server 2003 may have .NET pre-installed though.
Kevin
|
|
|
|
|
Hello,
It would be so great if somebody can tell me how to test if a port on my PC is free or not.
My client PC, that I am building, has to inform the server on which port this last can send a RTP video streaming through a udp connexion. And so, I want that my client PC find an unused port, to be sure that the transmission will succeed every time.
Many thanks for all kind of help and have a nice day,
alain
There is no way to happiness, happiness is the way !
There is no way to happiness, happiness is the way !
|
|
|
|
|
The simplest way is to simply try and bind to the specific port, if the bind succeeds, the port is free, otherwise it is not. For example,
TcpListener listener = new TcpListener(1234);
listener.Start();
If you don't want to check manually, you can pass 0 to TcpListener's constructor, it will automatically find a free port to bind to. You can then get that using the LocalEndPoint property.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|