|
It's a starting point which would, I hope, but know all too often will not, help the OP to a) make better use of search engines and MSDN, and b) think for themselves.
|
|
|
|
|
Thanks for you help! I'll find the solution. Sorry for reply later!
|
|
|
|
|
I am sure you learned a lot implementing a custom ComboBoxItem using 'OnDrawItem. As you've found out, trying to access the hidden internal ListView that is displayed when the ComboBox drops its DropDown is problematic.
The only Event I've found that lets you determine the location of the mouse for any action in a ComboBox DropDown, without using WinAPI, is the SelectedIndexChanged Event. Consider:
private private Point hitPoint;
private int deleteThreshold = 100;
private void SomeComboBox_SelectedIndexChanged(object sender, EventArgs e)
{
hitPoint = SomeComboBox.PointToClient(MousePosition);
if(hitPoint.X > deleteThreshold) SomeComboBox.Items.Remove(SomeComboBox.SelectedItem);
} You could simplify this in a way that does not require 'OnDrawItem, however, the "sacrifice" would be that you would include the "X" as part of the Text of the ComboBoxItem itself, so the "X" could not appear in any special Font, not have any special formatting.
If you want to see an example of this, just let me know, and I'll post sample code here.
“The best hope is that one of these days the Ground will get disgusted enough just to walk away ~ leaving people with nothing more to stand ON than what they have so bloody well stood FOR up to now.” Kenneth Patchen, Poet
|
|
|
|
|
Thanks for your help Sir. I'll try your suggestion. I like DIY, not just taking.
|
|
|
|
|
Member 10413292 wrote: I like DIY, not just taking. That's a great attitude; my best wishes for your success Bill
“The best hope is that one of these days the Ground will get disgusted enough just to walk away ~ leaving people with nothing more to stand ON than what they have so bloody well stood FOR up to now.” Kenneth Patchen, Poet
|
|
|
|
|
hi ,i use 4 picture box in my project and i write some codes in mouse_enter and mouse_leave event of this picture box it's here:
Size s;
Point p;
private void pbReporting_MouseEnter(object sender, EventArgs e)
{
s = pbReporting.Size;
p = pbReporting.Location;
pbReporting.Size=new Size(s.Width+12,s.Height+12);
pbReporting.Location=new Point(p.X-6,p.Y-6);
Refresh();
}
private void pbReporting_MouseLeave(object sender, EventArgs e)
{
pbReporting.Size = s;
pbReporting.Location = p;
Refresh();
}
and when i execute my project it's ok but when i choose a background for my form when mouse go to on picture box and leave it,it's has a slow motion moving.
you can download my project HERE:
http://Trainbit.com/files/6220359884/WindowsFormsApplication2.zip[^]
can you help me???
|
|
|
|
|
I assume this is a Windows Form project. ... yes ?
First, check these to see if they make any difference:
1. make sure your Form's 'DoubleBuffered Property is set to 'true
2. try taking out the calls to 'Refresh in your 'MouseEnter and 'MouseLeave EventHandlers.
Then, you might try this:
private int pbSizeIncrement = 12;
private Size pbBaseSize;
private Size pbEnterSize;
private Point pbBaseLocation;
private Point pbEnterLocation;
private void Form1_Load(object sender, EventArgs e)
{
pbBaseSize = pictureBox1.Size;
pbEnterSize = new Size(pbBaseSize.Width + pbSizeIncrement, pbBaseSize.Height + pbSizeIncrement);
pbBaseLocation = pictureBox1.Location;
pbEnterLocation = pbBaseLocation;
pbEnterLocation.Offset(pbSizeIncrement / -2, pbSizeIncrement / -2);
}
private void pictureBox1_MouseEnter(object sender, EventArgs e)
{
pictureBox1.Size = pbEnterSize;
pictureBox1.Location = pbEnterLocation;
}
private void pictureBox1_MouseLeave(object sender, EventArgs e)
{
pictureBox1.Size = pbBaseSize;
pictureBox1.Location = pbBaseLocation;
} I might also experiment by having two PictureBoxes defined, holding the same Image, but one sized larger than the other, and then switching the visibility of the two. You could position the second, larger, PictureBox correctly, and set its initial 'Visible state to 'false. Then:
private void pictureBox1_MouseEnter(object sender, EventArgs e)
{
pictureBox2.Visible = true;
pictureBox1.Visible = false;
}
private void pictureBox2_MouseLeave(object sender, EventArgs e)
{
pictureBox1.Visible = true;
pictureBox2.Visible = false;
} That would have the advantage of requiring no load-time calculation, and no run-time resizing/re-positioning of a PictureBox.
If none of these suggestions makes any real difference in run-time behavior, I'd certainly want to consider the nature of your hardware (cpu speed, amount of ram, etc.), and I'd want to take a close look at the sources of your images to see what their size, and formats were.
“The best hope is that one of these days the Ground will get disgusted enough just to walk away ~ leaving people with nothing more to stand ON than what they have so bloody well stood FOR up to now.” Kenneth Patchen, Poet
|
|
|
|
|
|
HI All,
Could any one please help on below
I want to open and save a pdf file using AcroRd32.exe command line and have to supress the GUI.
If above one is not possible (since most of them told its not possible), Please post if any alternatives with C#/Batch file/Command Line.
Thanks in advance..
Kind Regards,
Naresh M
|
|
|
|
|
|
hi
please tell me how to use a key in md5 encryption algorithm and how can I decript using MD5
|
|
|
|
|
You can't; MD5 is a one-way hash, not an encryption algorithm. There's no way to decrypt it.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Down vote countered.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
It doesn't matter how often you down vote people, that won't change the facts: MD5 is not an encryption algorithm, and the output cannot be decrypted back to regenerate exactly what was input. This is because it is a Hashing algorithm, which "throws away" information when it generate the MD5. It effectively works klice the more primitive SUM for generating a checksum:
byte sum = 0;
foreach (byte b in myData)
{
sum += b;
} Although this generates a "unique" code which can verify that the myData is unchanged (to a limited extent) you cannot take the single byte output and regenerate the exact input from just that.
MD5 (and SHA) work the same way: they use and discard information to get a value that can give you a very high confidence that the data is unchanged, but it can't be "decrypted" back to the original input. Otherwise, we would just store the MD5 of a video file and transfer just 128 bits instead of 700Mb and just "decrypt" it at the destination...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
What you are stating is not true - You can revert MD5 if you don't exceed the maximum of 1 byte
The scariest moment is always just before the Start - Stephen King Die Frauen warten auf die Liebe, und die Männer warten auf die Frauen - Wolf Wondratschek
|
|
|
|
|
Hmm. Yes, that would work.
I must immediately encrypt each byte of my files into MD5...
...hang on, why did they all get 32 times larger?
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
While it seems unlikely that you actually meant to ask "how can I generate a pre-image of an MD5 hash", that would be a much more interesting question, so I'll pretend you asked it.
In general, that's still "very hard". That is, given a random MD5 hash x, it's not (yet) feasible to compute a string that would hash to x (though there is an 2123.4 attack, which is better than brute force). By the way, there is obviously an unlimited number of strings that would have the same hash, because there's an infinite number of different strings and only a finite number of MD5 hashes. So in general it's not possible to get the actual original string, but you may find a string that has the same hash, and for short strings there's a very good probability that you would have found the original.
By contrast, generating two strings that have the same MD5 hash is efficiently doable[^] and highly realistic.
If you know something about the key, for example that it's an 8-letter alpha-numeric string, a brute force attack is often very feasible - for this example, it would take several hours on a good GPU. (26+26+10)8 / 10GH/s[^] = about 6 hours, and you could buy a better GPU, or several.
MD5-ed passwords hashes can also be easy, it depends. On the one hand, it's obviously possible to make a long random password, and you won't crack it. But on the other hand, most passwords used in real life are not like that. See for example this article[^] about some of the subtleties of passwords.
|
|
|
|
|
First of all you need to understand difference between Hashing and Encryption. Based on your requirement you need to choose correct method to secure your data. Check this[^] thread to understand why MD5 is irreversible.
|
|
|
|
|
i have create a page which work like browser but when i click on link/button in website to open new page it open in default browser of my computer .how i face this problem.i want open new page in my form
sumit
|
|
|
|
|
Don't repost! We read it the first time...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
It would be nice if you can share whatever you did. We can identify your issue easily. try to post your question descriptive.
Even i suggest to post reason for doing that work. Some people may have different way of doing the same thing with less efforts.
"Sometimes Questions are so nicely formed so we attract to give them answers." I call it An Effective Question.
|
|
|
|
|
i have create a page which work like browser but when i click on link/button in website open new page it open in default browser of my computer .how i face this problem.i want open new page in my form
sumit
|
|
|
|
|
How To Deloyment project in C#
|
|
|
|
|
|
I think you'll have to supply a bit more information - we cant read your mind
what sort of project ?
how many dependencies & 3rd party libs/dlls are there ?
what is the target system - does it have the same C# runtime/framework version ?
Are you talking with a database for example
do you need to do a firewall change request for the deployment machine
(for instance)
The last time I had to do this I simply created an msi and made sure that had all the dependencies/3rd party dll's within it, copied that to the deployment machine, ran it, and off I went - but every situation varies
|
|
|
|
|