|
You could always store the objects in some data structure and draw them on the screen everytime it paints itself.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
C# does not support the VB6 behaviour. It's not a good practice to draw upon the existing graphics of any control. Follow this link[^]for the answer to your problem.
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
You will have to repaint the circel every time the control is repainted, this is simply done by using a override OnPaint method or likewice.
Best Regards
SnowJim
|
|
|
|
|
Hi,
I'm working in a class library project and I'm trying to design the code in the best way possible.
I have an abstract class that represents the header of one file defined like this:
<br />
public abstract class FileHeader<br />
{<br />
<br />
protected FileHeader()<br />
{<br />
}<br />
<br />
<br />
public abstract void Open(string filePath);<br />
}<br />
Now the question is:
My header class should be readonly (cannot set properties values from outside), but my derived classes should be able to set the fields in their implemetation of Open method.
According to the Design Guidelines for Class Library Developers from MSDN, we shouldn't leave protected fields in base classes, so the only way I can see is to add a protected method to set each field... and that don't sounds good...
Could anyone give me some ideas here?
Thanks! and sorry for the long post
|
|
|
|
|
I've felt the same problem too. It would have been nice if we were able to specify different access specifiers for set and get. If that was possible, you could've declared get as public and set as protected.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Help....
I've written a great little C# app which I want users to download from the internet. But I need to do the following and would appreciate help...
1) I want users to be able to download an 'unregistered' product which is time-limited.
2) At any time, the user can register on my web-site and then receive an unlock key which gives them unlimited access
3) Any updates they download will not require re-registration/unlocking
Can anyone point me to a good product that will allow me to integrate this protection into my app?
Thanks
Mark
|
|
|
|
|
Hi,
have a look at Xheo. If the costs arent too high for you you will get a very sopphisticated licensing tool. But keep in mind that .Net programs are in general easy to decompile. Thus you always have to obfuscate your libraries to make it at least a bit harder for professionals to crack this
|
|
|
|
|
Robert...
Great...
Thanks
|
|
|
|
|
Hi!
I'm looking for a way to find the position of a certain pattern within a string. On my search on the internet I've come accross various algorithms such as Knuth-Morris-Pratt and Boyer-Moore (just to name two). But which is the fastest?
|
|
|
|
|
|
Thanks a lot! I'll give it a try.
|
|
|
|
|
please everybody don't get bored from me ....
=============================================
the first question :
===============
i think you know the most famous remote administration tool which is called subseven
when you unzip the tool from its compression it extract for you the client tool of that program and there is an option that you can configure yourself some options like the email address that the server will send you the ip address to and other options and after that you can build up your server with the new input options in it and it will work properly
the question is :
iam building the same application but it is chat application server and client application i want when i deploy my server i need when i install the server to put the same option cause i want the user who will use my application have the same ability to change some options like the ip address of the server that it will listen to and the port and the name of the form client and other options and then he can build up the client executable file with the same options and information he entered and then the client is built successfully ???????
second question :
=============
How can i use the directx or any other component that i can broadcast the instant sound from the microfone of one chat client to the other side (Second chat client) who they are chatting to each other through the network by the way i succeeded to design multithreaded server for private and general chat with webcam broadcasting but i didn't succeeded yet to transfer the sound !!!!!
third question :
===========
i want my server when it is minimized to run in the desktop bar with its specific icon like the microsoft sql server 2000 and yahoo messenger something like that and when that icon is pressed by the mouse it pop up context including options like (run,stop) and others
Any help of any previous questions
Thank you my brother i will be too appreciated if any of previous questions was answered
Thank you
Your brother ;
Snouto Override
Miss With The Best And Die Like The Rest
|
|
|
|
|
Hello,
I have decimal vars which I retrieve from my database. They have a precision of 7 digits.
I want to use these to calculate various things and save them in an other database with only 2 digit precision.
So how can I set my (for example) 2,4567000 to 2,45 ?
Thanks in advance !
|
|
|
|
|
Just divide it by 10 to the power of 7-2 = 5 digits? 2,4567000 / 10^5 = 245. Is that what you want?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Well it should be a function not based on the length of the original var.
When they change the length in the original database from 7 to whatever the function should be left untouched.
So I should be able to get a 2 digit precision from a decimal with any possible precision, without rounding or whatsoever.
|
|
|
|
|
I guess you can figure out the length of the original variable and then divide accordingly. Off the top of my head
private int GetDoubleDigit(int var)
{
int retVal = var;
int length = var.ToString().Length;
int n = length - 2;
if (n > 0)
retVal /= (int)Math.Pow(10, n);
return retVal;
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
No need to convert the thing to a string. Just do the math on it. Move the decimal point to the right however many places you need, integer the result, then move it back to where it was. Look at my reply to the OP for the quick and dirty code.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Easy. Just do a little math on it. Multiply your number by 100, get the integer of that, then divide that result by 100. Instant 2 decimal truncation. Quick and dirty:
public static double Truncate(double value, double precision)
{
double x = Math.Pow(10, precision);
return (double)((int)(value * x)) / x;
}
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
This isn't necessarily a C# question. Any ideas how to prevent PrtScn from doing it's thing?
I know there's a variety of screen capture programs out there, but let's assume for the moment that the client's environment is sufficiently controlled that a third party screen capture app isn't an issue. But we do want to stop the built-in prtscn from working so that an unscrupulous client can't take screen shots of sensitive information.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
i have an idea and i think it may help you
==========================================
you can check all your open ports in your pc and then listen to them all and then refuse the connection request comes from any port this is the idea behind any firewall application i guess so ..............
about the designing of this programmer is very easy to preform
Thank you my brother....
Miss With The Best And Die Like The Rest
|
|
|
|
|
i think he meant printscreen, not portscan... either that or im even more confusticated than i thought .
on the other hand, listening to open ports to stop a a printscreen sounds like an interesting challenge for masochists
|
|
|
|
|
How about a keyboard hook that gets loaded at system startup and swallows all PrintScreen keypresses?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I agree with Kumar. A keyboard hook will let you stop the PrintScreen key from ever reaching the system. I wrote up something similar in C++ a few years back to eat the Windows key.
I also seem to remember hearing somewhere that if you change the Opacity of the form, even to 99%, PrintScreen won't see your form. Try it, see what happens. But the down side to this is that it might not work like this with all video drivers and versions of Windows, especially future versions. Ack! Forget I mentioned it!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
i think i wrote meaningful article mr.mav.northwind
but here is my question again :
i need to make the same option in my chat application as the option in subseven (Remote administrattion tool) which you can put some options to configure the server and then you can build it up ? anybody worked with subseven when you open the client file for the first time you have to configure your server and then you push create button and it creates the server for you with the information you entered as Your email address which it will send the ip address of the computer to ...
i need to make the samething in my application any help with that .....
|
|
|
|