I have no idea what you would want to see. Other than than the fact that I am using a regular System.Windows.Forms form, I have no idea what else matters. All that I should need to do is write an overridden onpaint method... doing this has worked in other applications. that is the only thing that I know is relevant. I have simply written a method override. Here is the content but its all commented out because except for the call to the base method because it wasn't working. Putting a break point in here indicates that the method isn't being executed at all. It is working fine in other applications where I have overwritten the OnPaint method.
protectedoverridevoid OnPaint(PaintEventArgs e)
IntPtr dc = GetDCEx(hWorkerAPI, IntPtr.Zero, (DeviceContextValues)0x403);
base.OnPaint(new PaintEventArgs(Graphics.FromHdc(dc), e.ClipRectangle));
And you are right - that should work for WinForms, and a breakpoint should be hit.
And I'm sorry if this sounds like you don't know what you are doing, but I can't see your screen, so we need to start with basics.
1) Are you testing under the debugger?
2) Have you checked the OnPaint override is in the right form class?
3) Have you tried handling the Paint event for the form via the designer?
Sent from my Amstrad PC 1640 Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
OK ... that doesn't helps ...
My questions are :
- you work with FORMS ...?
- you have created you own customized Form (I call it myForm) which derives from FORM ...?
- on that myForm you overrided the Method OnPaint ...?
- you have tested how it works with another Form (perhaps called Form1) which derives from myForm ...?
- why are the code-parts in your sample code commented out ...?
If you answer all of these questions it is perhaps possible to help you ...
Hello all who have made comments. I am replying to my own comment so that I can address all of your comments in one reply.
All of you except for OriginalGriff are asking questions that I have already implied or explicitly written answers too:
Perhaps some of you don't speak English so I will clarify. This statement implies that the code I provided above is in a class derived from System.Windows.Forms:
"Other than than the fact that I am using a regular System.Windows.Forms form"
As for why I commented code out, I answered that question with the statement:
"Here is the content but its all commented out because except for the call to the base method because it wasn't working."
If you don't understand any of the above statements, then ask about that. Otherwise please don't ask questions that I have already answered. It wastes everyone's time. For my part, I probably could have written that second statement better as:
"Here is the content but it's all commented out because, except for the call to the base method, because it wasn't working."
3. No. I did not want the form drawn normally under certain conditions.
I wrote a test program to both figure this issue out and move forward with my purpose since that test program is working correctly. I have learned that overriding OnPaint will not accomplish what I am currently trying to do (which is to make the application into a desktop widget when the user decides... that means drawing it as part of the desktop). However, I would still like to troubleshoot this in case I need to override OnPaint for another reason... chances are good I may need to since this is a very customized form.
Yeah. I know. I tried it again in the newer "test" app (as I mention in my most recent post above). It works fine. I still can't find anything wrong with the project app. I am hoping someone will have an idea of what could possibly get in the way of the override being called.
Hi all, I'm following a basic dotnet core tutorial ASP.NET Tutorial | Hello World in 10 minutes | .NET using a SBC Nanopim4 running Armbian. I've reached the dotnet run stage Of the asp sample ) and it reports it's listening on ports 5000 and 5001. However I can't browse to the site and if I run nmap from my laptop it returns both ports closed. Another thing is, if I run nmap localhost on the Pi it returns ports open but using it's actual ip address it returns ports closed - any ideas folks ?
We can’t stop here, this is bat country - Hunter S Thompson RIP
Thanks Richard, through that link I found that you can modify Properties\launchSettings.json as I show below - and all is good - probably not the way to do it in a production app but good enough for my learning at this early stage, The 10.10.1.143 parts were set to localhost. Thanks again.
Basic way to test net connectivity in windows (but same exists in linux.) Open a console window and type the following command.
telnet <host> <port>
Substitute in the above for the values you want to test for <host> and <port>. For example
telnet localhost 5000
There are several possible outcomes.
1- It reports immediately that it cannot find the host. This indicates a "Domain Name Server"(DNS) error. Outside the scope of what you are currently doing but generally because you typed the wrong value or you do not know the correct DNS name
2- It reports a no connection error immediately. That means it got to the computer (DNS) but that the port on that computer was not 'open'. So the app that you expected there was not in fact there.
3- It sits for a while and then reports an connection failure. That indicates that it is trying to get to the DNS but something is dropping the connection attempt between it and the computer. This is often a firewall or network issue.
4- It returns a blank screen. That indicates it successfully connected and thus the connectivity test is done.
What might one expect from such a test based on your description. I would suspect 1 or 2. You are using the wrong DNS or even though it 'reports' that it is waiting on that port either it isn't doing that at all or it opens it and immediately closes it.
Should note that these days this works for everything: http, https, soap, rest, TCP.
I need to connect to an old VMS server, that's not supported, via FTP, and change directory multiple times within the same session, to count the files in each directory.
I believe I can do this within Wininet.dll api in C/C++.
But when I look at the .NET Framework, I don't see a change directory function within FTP.
Any idea what is the best way to change directory (multiple times) within the same FTP session, and count a total number of files within each directory?
NOTE: I would also like to count the files in read-only if that's possible, just in case one of the files may be getting processed.