|
|
Re post [^]. Please just wait for some time till you get reply. Don't post your question in multiple forums, only on relevant.
|
|
|
|
|
hi thatraja,
i think this question is relevant to both c# and ASP.net. anyway thanks for suggestion.
|
|
|
|
|
you right, but the page & forms are more relevant to ASP.NET here, so you can get from there. cheers.
|
|
|
|
|
I have several controls that use the same context menu. How do I know which control was clicked to bring up the context menu? I want the context menu to be able to edit only the control that was originally clicked.
|
|
|
|
|
If you add a handler to the ContextMenuStrip (probably the most useful to you is ContextMenuStrip.Opening) it gives you a "sender" parameter:
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
ContextMenuStrip cms = sender as ContextMenuStrip;
if (cms != null)
{
MessageBox.Show(cms.SourceControl.Name);
}
}
The ContextMenuStrip.SourceControl property gives you the control which will cause the menu to be displayed.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
I am facing a problem while filtering using the datatable class select function.
Following is the code.
DataTable dt;
DataRow dr ;
dt = New DataTable()
dt.Columns.Add("t", System.Type.GetType("System.String"));
dr = dt.NewRow();
dr["t"] = "12";
dt.Rows.Add(dr);
Dim search As String
'There is no problem when i write the following search string
search = "~!@#$%^&*"
dt.Select("t like '%" + search.Replace("%", "[%]").Replace("'", "''") + "%'");
but problem comes when i append a special character ( with the search
search = "~!@#$%^&*(";
dt.Select("t like '%" + search.Replace("%", "[%]").Replace("'", "''") + "%'");
Error message is
Error in Like operator: the string pattern '%~!@#$[%]^&*(%' is invalid.
|
|
|
|
|
abcurl wrote: search = "~!@#$%^&*(";
Try search=@"~!@#$%^&*(";
Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Im trying to implement a car horn sound clip into my robot. When I press the right bumper of my xbox 360 controller, a car horn should sound and if I hold it down, it should continue the sound untill i let go, like a real car horn. If i loop the sound it will just beep very fast...any ideas as how to accomplish a relaistic car horn sound?
|
|
|
|
|
I think you should have to use delay in between. but it will not very useful when you press continue. bacause sound clip somthing like increasing/decreasing.
in short try to make use of different sound clip in different scenario.
Life's Like a mirror. Smile at it & it smiles back at you.- P Pilgrim
So Smile Please
|
|
|
|
|
This is usually achieved well in flash games. I have seen these such sounds there.
Or, you could use a really long file. say 5 minutes. Now, noone is going to honk that long.
|
|
|
|
|
I've actually written a program - I'll post it later, but right now, I'm having difficultly with this problem: storing a high sore list. I'd prefer a cross-platform (should be generic enough to also work on Mono) way to store the scores and some other variables in a text file, and easily read, parse into a ListView/DataGridView and write.
I don't want to use SQL Server or Access, as they are overkill for my needs.
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. - Calvin (from Calvin and Hobbes)(The Indispensable Calvin and Hobbes, p105-3)
|
|
|
|
|
|
a simple text file could do; maybe a CSV; maybe XML.
if sharing amongst multiple users is important, be careful about concurrent accesses.
|
|
|
|
|
I'm not too worried about sharing - it's all in the user's home directory (my excess Linux use is reflecting off Windows, wow) and I'd like a nice simple two-way wrapper. If I can read it with foreach, it shouldn't be too hard to add the items into a ListView...
BTW, CP seems to randomly barf XML errors after loading various pages, so if you see a double post, not my fault.
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. - Calvin (from Calvin and Hobbes)(The Indispensable Calvin and Hobbes, p105-3)
|
|
|
|
|
File.ReadAllLines() and string.Split(',') make reading a CSV quite easy.
XML is an alternative, easy once you know your way around in the Xml classes.
Serialization is also a possibility.
The Cake of Deceit wrote: CP seems to randomly barf XML errors
never seen that myself. you might bring it up in the suggestions forum, best with URL of pages that (sometimes) do it, plus details on your OS and browser.
|
|
|
|
|
Luc Pattyn wrote: string.Split(',') make reading a CSV quite easy
Not if the CSV has commas in the values, e.g. ...,"Pattyn, Luc",...
|
|
|
|
|
I would never do that. That deserves two fields.
When I use CSV, I choose my comma carefully; and when in doubt I remove it from the data fields when storing!
In general, you're right of course.
|
|
|
|
|
Well, book or movie titles that include commas.
Luc Pattyn wrote: I choose my comma carefully
Yes, one should never use a comma as a comma.
I've known people to only use Caret (^) as the delimiter because it's unlikely to be in the data.
I just prefer to put quotes around string values just because.
Luc Pattyn wrote: In general, you're right of course.
I think I'll post that on my wall.
|
|
|
|
|
PIEBALDconsult wrote: I think I'll post that on my wall.
Why, it isn't there yet?
|
|
|
|
|
I'm dumbfrazzled myself. I just have two columns in the list view, and want to at least read the CSV and parse it in. I don't need to transform LV's into CSVs, as I write to the CSV. All I ask is for a simple way to read and write CSVs, with an easy to to add the CSV items into a list view. Nothing to complicated, just an int and string in two columns.
If there are missing Cs, my keyboard's C key isn't very responsible, sorry about that.
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. - Calvin (from Calvin and Hobbes)(The Indispensable Calvin and Hobbes, p105-3)
|
|
|
|
|
FileHelpers[^] is an excellent library for working with various file formats. Check out the home page[^]
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Nice find - I'll be checking this one out myself
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
hi
brother
i search from someone who can make small program for me
if u can tell me
f0f020002000@yahoo.com
|
|
|
|
|