Click here to Skip to main content
14,328,128 members

Comments by Ramza360 (Top 87 by date)

Ramza360 8-Jan-18 14:18pm View
   
The ListView itself was designed this way, unchecking one of any selected items will in fact uncheck them all. You can get around it by making a list of the 'other' items that are checked/selected, unselected them, uncheck this item clicked, then reselect the others.
Ramza360 19-Dec-17 9:39am View
   
You should add a breakpoint to ensure the classType is not null at that point. Also if your type has no default constructor, you must provided the constructor arguments.
Ramza360 14-Dec-17 15:18pm View
   
You prolly shouldn't be trying to clear during the mouse moving? Seems this would be clearing what you just drew, before releasing the mouse. Perhaps in onmousedown, it should first clear the context.
Ramza360 16-Nov-17 12:13pm View
   
Good catch there as well ;)
Ramza360 15-Nov-17 9:31am View
   
Yup you create it and never close it before trying to open it for reading.
Ramza360 28-Mar-17 9:45am View
   
Its a VS 2015 thing (well C# 6.0 to be exact), but with VS 2015 you can use some of these features (including this one) with even c# 4.0.
Ramza360 24-Mar-17 15:15pm View
   
That is incorrect CHill60, you can initialize properties using that syntax in C#.
Ramza360 22-Feb-17 12:21pm View
   
O.o gotcha
Ramza360 21-Feb-17 17:17pm View
   
Everyone on here repeated the previous solution / comments. I added an extra piece of *help* that most tutorials will not point out about reversing the comparison to have non-modifiable values on left side.

Regardless, the OP has a few answers to *hopefully* learn from :)
Ramza360 21-Feb-17 16:36pm View
   
Why the down vote, it explains the issue, and a good programming concept.
Ramza360 17-Feb-17 14:38pm View
   
Well its at least very fast, albeit inefficient.
Ramza360 17-Feb-17 12:07pm View
   
oh lol you wanted it efficient. Haha
Ramza360 17-Feb-17 12:06pm View
   
yup sure is
Ramza360 17-Feb-17 10:43am View
   
I just removed the loop collecting the invalid characters, so that's not confusing to you, however you are still trying to load the text using .Load, and not using the XmlTextReader at all. Also if you are using my code to remove invaluid characters, you need to use the string from the StringBuilder as the LoadXml parameter...
Ramza360 17-Feb-17 10:21am View
   
Your changes do not reflect what i've posted in my solution. You are instantiating an XmlTextReader but never use it, just use XmlDocument's LoadXml after you remove the invalid characters.
Ramza360 16-Feb-17 11:33am View
   
There i just added a piece of code that will remove illegal characters, if that is not sufficient or you need some other character in place of those, change the loop to add that character when not a valid xml char.
Ramza360 16-Feb-17 11:19am View
   
Added a loop to check for invalid characters, to at least get you started in finding them. You can change it so the invalid characters are automatically replaced which is probably faster then hunting them down yourself.
Ramza360 16-Feb-17 11:04am View
   
The input was an example, I will change it to your variable to stop the confusion. However about the illegal characters in path, that means there are characters in the XML text that are not valid for XML. In that case it may be prudent to check for illegal characters (removing them or replacing them).
Ramza360 16-Feb-17 10:58am View
   
Furthermore, calling doc.SelectSingleNode will look for the node at the top level and not go any deeper into the xml nodes. You need either look at the child nodes of the xNode for them (or for adding to), check for null then do something with the values, or use xPath. I will update my solution.
Ramza360 16-Feb-17 10:56am View
   
Yes the 'input' i was referring to was you richTextBox1.Text. That said, if it does not fail on that line then the text is formatted correctly, its just a matter of looking for what you need.

You have doc.SelectSingleNode calls that do not exist, and then doing a .InnerText on a null node causes error.
Ramza360 14-Feb-17 15:24pm View
   
Since WinForms does not support the kiosk mode, you are going to have to disable those keys, and task manager shortcuts. There are some examples of this here: http://stackoverflow.com/questions/3213606/how-to-suppress-task-switch-keys-winkey-alt-tab-alt-esc-ctrl-esc-using-low

The above link apparently works in some situations, but not all. Might consider switching to WPF?
Ramza360 6-Feb-17 11:40am View
   
no combo is the integer... Look at the OP
Ramza360 2-Feb-17 13:12pm View
   
Are you trying to populate the text box when clicking on a cell in the data grid view? As CHill60 stated, it's not clear.
Ramza360 18-Jan-17 15:31pm View
   
What framework/library are you using to capture the humoments?
Ramza360 17-Jan-17 11:35am View
   
How big of a shadow are you making here if your doing the TranslateTransform(0, 1) in a for loop? If you need a single shadow, just get the shadow color, and draw the text at an offset, before drawing your main text

The offset could be (x + 1, y + 1) for bottom-right, (x - 1, y + 1) for bottom-left, or (x + i, y + i) if your doing many times though would need to switch the loop to for (int i = d; i > -1; i--){}
Ramza360 7-Jan-17 11:04am View
   
Just click again in the cell to un-highlight the text
Ramza360 30-Dec-16 13:43pm View
   
Thats a good idea as well. Congrats on learning to code. It is so much fun!
Ramza360 28-Dec-16 12:10pm View
   
This is the correct solution.. You cannot use that in C due to sizeof being a compile time pointer. I've deleted my solution as I did not realize it was just a C related question.
Ramza360 28-Dec-16 11:43am View
   
Deleted
In the AI method, you're allowing multiple choices since there are more than one if blocks. So any of the if blocks can evaluate to true, setting the additional 'O'. You have potentially 10 points due to the 10 if blocks, most likely they all would not evaluate as true (this includes the else if parts) but always the chance.
Ramza360 22-Dec-16 14:46pm View
   
If your trying to display the data to the user, just cast the hash table using a LINQ statement and set the data source property. In fact using this method you can allow a privileged user to edit the value, which upon edit submit, you must update the hash table entry.
Ramza360 16-Dec-16 16:34pm View
   
Your problem is you are overwriting your file since you are simply creating a StreamWriter and writing a line, then closing the file. You need to specify a StreamWriter with a FileMode as hari19113 stated. Check my example below.
Ramza360 16-Dec-16 11:06am View
   
This works well however you do not need the foreach, use the GraphicsPath.AddLines(points) does the same thing. Quick addition to your solution i added below.

And yes it is simple in c#
Ramza360 13-Dec-16 9:58am View
   
Hi Marc you need to subscribe to the Deselecting Event on the TabControl.
Right click the TabControl and select Properties. In the Property Grid click the thunderbolt icon which will show you the events. Locate the Deselecting Event and type in the name of the method you would like. Copy/Paste the code into that method (only copy the foreach loop into the new method)
Ramza360 9-Aug-16 16:54pm View
   
Try virtualization with a data source.
Ramza360 28-Jul-16 12:02pm View
   
Try the momento pattern.
Ramza360 11-Mar-16 16:34pm View
   
The TargetInvocationException is caused from trying to access the control from the background thread directly. If you absolutely need to do that, it must be invoked, allowing the correct thread to perform that operation.
Ramza360 11-Nov-15 10:25am View
   
Have you tried doing an int.TryParse on the Value2 object?
Ramza360 29-Jul-15 10:05am View
   
Sounds like the right answer to me!
Ramza360 1-May-15 16:27pm View
   
What have you tried? Should look into the DataGridView events and see what you can come up with.
Ramza360 25-Mar-15 12:28pm View
   
If for whatever reason you absolutely want the Graphics object there, you would need to create the graphics (i.e. this.CreateGraphics()). Though the Paint method is the best place for such things.
Ramza360 10-Mar-15 9:38am View
   
Are you referring to the Web.UI grid view or the winforms DataGridView control?
Ramza360 6-Mar-15 23:27pm View
   
Yes this is a good point. I will keep it in mind in the future.
Ramza360 6-Mar-15 15:10pm View
   
No Problem :)
Ramza360 6-Mar-15 15:09pm View
   
Using File.Exists(file) would work as suggested by OriginalGriff too, but you'd still have to decide which way to show the files in the message box.
Ramza360 6-Mar-15 15:07pm View
   
I'd suggest the second, as it will give them one message box with the list of missing files at the end while the printing is occurring. This way you wont block the other actions.
Ramza360 21-Feb-15 13:16pm View
   
Well that's awesome. Glad its working better. I figured lowering the time would cause other issues.. Hope the testing goes well :)
Ramza360 21-Feb-15 11:19am View
   
so its still just not printing? Seems a bit odd. And the adobe reader opening at all is a pain in the butt. Try that link i posted too, it goes into more detail on this subject, right here on CodeProject. I'm sorry I can't be of much more help in this regard.
Ramza360 21-Feb-15 10:50am View
   
also might be good to just make sure its entering the methods, try setting some breakpoints, check to see what the path string contains and whatnot.
Ramza360 21-Feb-15 10:44am View
   
also try adding this to ensure adobe is opened minimized.
info.Arguments = @"/p /h";
Ramza360 21-Feb-15 10:40am View
   
That would probably suffice. I'm looking to see if msdn has any other options as well, which seems there is one lengthy set of instructions for sending raw data to the printer, but that shouldn't be need in this case.
Ramza360 21-Feb-15 10:37am View
   
It may have to do with the sleep. I have noticed that 3 seconds may be to fast. However this may also force adobe to show up again..
Ramza360 20-Feb-15 20:20pm View
   
Yea good point just addin the resource as you have shown above does the trick however m solution does work for getting the embedded resource as shown by msdn. Dont think this was worth a down vote IMO.
Ramza360 20-Feb-15 19:31pm View
   
Hope it all works for you.. :)
Ramza360 20-Feb-15 18:47pm View
   
I just updated the solution to use a 'click' event. The issue with adobe showing and closing is most likely environment specific. I am adding a link to another code project article that addresses this.
Ramza360 20-Feb-15 18:26pm View
   
Well the code above does check through all the items without you selecting one however this can be moved to a click event. Just substitute the dir with the slimeyy directory path. As for the adobe opening and closing that may depend on your settings. For instance on my comp I see no window it just prints.
Ramza360 20-Feb-15 10:35am View
   
That is the shorter way about it :)
Ramza360 17-Feb-15 10:51am View
   
added
Ramza360 17-Feb-15 10:44am View
   
Did you try to specifically call Focus or Activate on the form, say after f.Topmost = true?
Ramza360 12-Feb-15 10:31am View
   
no problem.
Ramza360 12-Feb-15 9:53am View
   
Yes go read documentation. On the line Console.WriteLine(span), it just simply uses a TimeSpan object with no format specified, the output is 00:00:00.. Ergo using a timespan object .ToString() method alone gives the hh:mm:ss.......

And there are multiple ways of doing things, this is not the "wrong" way.
Ramza360 12-Feb-15 9:50am View
   
Yes go read documentation. On the line Console.WriteLine(span), it just simply uses a TimeSpan object with no format specified, the output is 00:00:00.. Ergo using a timespan object .ToString() method alone gives the hh:mm:ss.......

And there are multiple ways of doing things, this is not the "wrong" way.
Ramza360 12-Feb-15 9:44am View
   
Sorry, spelling issue in the string.Format the 2:00 has a ) it should be a }.. Fixed in code
Ramza360 12-Feb-15 9:32am View
   
didn't have to go try it in code.
Ramza360 12-Feb-15 9:30am View
   
The default of a TimeSpan object ToString() produces the hh:mm:ss.
Ramza360 11-Feb-15 19:49pm View
   
Yea.... Lol good call. My solution has been deleted..
Ramza360 4-Feb-15 9:47am View
   
Where is the error occurring?
Ramza360 4-Feb-15 9:35am View
   
Are you asking how to check an inputted character to determine if it is a number? It's a bit unclear as to what you are looking for.
Ramza360 31-Jan-15 15:08pm View
   
That's a good question, not entirely sure how to answer it. Perhaps someone else can enlighten us both there.
Ramza360 31-Jan-15 14:41pm View
   
It was basically creating a reference to the classA object rather than a copy, so changing one, changes the other.
Ramza360 31-Jan-15 14:21pm View
   
Try Solution2 :)
Ramza360 31-Jan-15 14:20pm View
   
The reason for this is that your setting temp to the same object, and this is creating a reference in the objEven list and objDiv4 list.
Ramza360 31-Jan-15 10:42am View
   
HAHAHAHAHAHA So true... perhaps i should pay attention to that.
Ramza360 31-Jan-15 10:37am View
   
This is a correct solution if you want to set the child to the same "specified" point (e.g. using Location), otherwise you can use one of the other FormStartPositions. Perhaps you should test this (go ahead try it). It does exactly what he needs.
Ramza360 31-Jan-15 10:26am View
   
Yet another good point.. Got my 5.
Ramza360 30-Jan-15 12:24pm View
   
Yea validating is another way to go. Prevent the key altogether.
Ramza360 30-Jan-15 11:27am View
   
Very True. Fixed. Thanks for pointing that out.
Ramza360 28-Jan-15 12:10pm View
   
I must agree here actually..
Ramza360 26-Jan-15 23:25pm View
   
Agreed
Ramza360 26-Jan-15 14:44pm View
   
my guess is that whatever is in the textBox1.Text property is not parsable to an int 32, or the convertButton_Click has not been subscribed with the actual button click event. Should show the error however. I take your code out of the block and input a simple digit, miles = 10, runs perfectly.

I would suggest doing int.TryParse on the textbox text still..
Ramza360 5-Jan-15 10:26am View
   
Sounds like it might be good to open a word document, add each line from the file, format it then at the end just call the printout function.
Ramza360 2-Jan-15 9:54am View
   
Ahhhh if it is this you must achieve, then following the link posted by BillWoodruff has the functionality your require. The tree view control needs to show all nodes that you want to print, but before printing, you would need to determine how the pages should be printed. The tool look as though it does all of this.
Ramza360 1-Jan-15 13:40pm View
   
That page does have a nice easy to use tool, but if you just need something quick and easy, my solution works nicely.
Ramza360 31-Dec-14 13:03pm View
   
Very interesting, and that's kind of what i expected to. Only other thing i was thinking was if they thought the cases were doing the boolean check and replaceing the bool with its integer (true:1) (false:0) and seeing if they add up to 1. Ohwell.

Thanks for the quick reply.
Ramza360 31-Dec-14 12:55pm View
   
Ok this is just an example. However the issue is how the variables are given to me to evaluate in the above layout (e.g. (string == string + string == string) == 1). Was thinking maybe the plus meant something else in python but I guess the only way around would be to do a replace on the + as and, but that would break any expression containing the + in it.. Weird situation.

Thank you for the above explanation though, just wondering why they would think that would evaluate correctly then..
Ramza360 18-Aug-14 12:10pm View
   
Sergey, thanks for the information, it definitely helped. I think the custom control option just might be what I'll do, and keep track of tab index and visible tabs and such. Thought perhaps there was a message that could be used, however that message would never get called in the win API if not needed.

Thanks again!
Ramza360 15-Aug-14 9:33am View
   
The point of this post was to ask if it is possible to force the navigation arrows to remain, hence the sentence "Looking to create a tabcontrol that always shows navigation arrows, regardless if the size is not big enough for the amount of tabs."

Perhaps understanding the post should come first. Updated the question for clarity.
Ramza360 4-Aug-14 9:36am View
   
Are you using the $array = array() or $array = [] after the unset?

Is the array a global array? If so use unset($GLOBALS[$array]) syntax.