|
Hi gladiatron,
I don't use a form, its in a panel. And when i said i had set "it to fill", i meant i had docked it already.
Regards,
Gareth.
|
|
|
|
|
Hi,
AutoSizeColumnsMode = Fill;
Regards,
Gareth.
|
|
|
|
|
I have few checkboxes in my form, and i want to get only those which are checked. Can this be done only in 1 line of code? As i know the loop to execute and get the checked values.
Thanks in advance for your help.
|
|
|
|
|
What's a line of code?
If you encapsulate the details in a method you need only use that method.
|
|
|
|
|
What i mean to say, is it possible to do it without a loop only with 1 line of code ?
|
|
|
|
|
Only if the line is really long, or calls a method that does a loop.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Het2109 wrote: without a loop
Perhaps.
Het2109 wrote: with 1 line of code
Perhaps not.
How about adding a collection for the checked CheckBoxes to your form, and having the CheckedChanged event handler(s) add and remove them as appropriate?
|
|
|
|
|
PIEBALDconsult wrote: What's a line of code?
Things that might make a computer do what you want it to. Something the PHB has no true understanding what it is.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Het2109 wrote: few checkboxes in my form, and i want to get only those which are checked. Can this be done only in 1 line of code?
Probably only if you use a loop or as a procedure like CheckForCheckedCheckBoxes(); . What is it that you want to do with the checked checkboxes when you find them?
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
Add an event to the CheckChanged event. In that code you can use code to populate a list. The one line of code would be:
someMemberList.Add((CheckBox)sender);
In the event.
The easiest method, however, is just the if statements. You mentioned a loop so maybe this is ASP.NET so there is a complicated simple way to do it by getting the submitted value by the id of the check box so long as every check box has the same id.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: Add an event to the CheckChanged event. In that code you can use code to populate a list. The one line of code would be:
someMemberList.Add((CheckBox)sender);
In the event.
What about repeated clicks? Check - uncheck - check
|
|
|
|
|
object o = ((Checkbox)sender).Checked ? list.Remove((CheckBox)sender) : list.Add((CheckBox)sender);
Just might work, or some variation thereof There is always a way to write bad code. Use a hash to avoid duplicates if it really matters.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
I have been reading up a lot on the different standard file wipe algorithms that exists and I was hoping that someone could explain one thing to me.
Most of the algorithms are straightforward and shouldn't post to much difficulty to implement but I don't understand the verification part of some of them.
Take the standard DoD 5220.22-M for example which states:
- US Department of Defense DoD 5220.22-M (3 passes)
DoD 5220.22-M is three pass overwriting algorithm:
first pass - with zeroes, second pass - with ones and the last pass with random bytes.
With all passes verification.
or the US Army AR380-19:
- US Army AR380-19 (3 passes)
AR380-19 is data wiping scheme specified and published by the U.S. Army.
AR380-19 is three pass overwriting algorithm:
first pass - with random bytes, second and third passes with certain bytes and with its
compliment (with last pass verification).
The three passes is not a problem but what am I suppose to verify?
|
|
|
|
|
Maybe verify it's not the original data?
|
|
|
|
|
That's what I was thinking, but that doesn't seem very realistic.
Imaging if I wanted to erase a 4 GB DVD-ISO, that would mean I have to create a 4 GB byte-array before the first pass and compare each byte later.
|
|
|
|
|
Unless you things byte by byte as you go.
|
|
|
|
|
So if the random byte you want to write matches the existing byte, select a different random byte? Oh there's a good use for clock cycles.
|
|
|
|
|
Meh, they never said anything about that!
|
|
|
|
|
They must have forgotten to. What if your random bytes just happen to all match the bytes to be wiped?
|
|
|
|
|
PIEBALDconsult wrote: What if your random bytes just happen to all match the bytes to be wiped?
I believe the error message would read "Woahhhh. Bummer dude."
|
|
|
|
|
I was going to said BSOD it but Pete's answer is much better.
|
|
|
|
|
Read back each byte [after you write it] to be sure it's the same as what you thought you wrote?
Seems fairly pointless to me; what do you do if it's not?
modified on Monday, January 07, 2008 4:05:57 PM
|
|
|
|
|
PIEBALDconsult wrote: what do you do if it's not?
As always, try a couple of times, and if it continues to fail, report the failure.
|
|
|
|
|
Keep trying different bytes until one matches?
|
|
|
|
|
Wow, this is why I like Codeproject, I go to sleep and when I wake up, theres all these suggestions to my question.
However I think this is the most logical answer...
|
|
|
|