|
Hi, Thanks for your reply.
I tried that one.
ListViewItem item = listView1.SelectedIndices[0];
But error coming:
Cannot implicitly convert type 'string' to 'System.Windows.Forms.ListViewItem'
please help me...
Bi
|
|
|
|
|
Hello
Sure you can't do that. SelectedIndices is a collection of integers. You use them this way:
ListViewItem MyItem;
foreach(int X in MylistView.SelectedIndices)
{
MyItem = MyListView.Items[X];
}
Or more simply if you want to access a certain item -provided that you are sure that there are atleast one selected item-:
ListViewItem MyItem = MyListView.Items[MyListView.SelectedIndices[0]];
If there are no selected items, or you put a number larger than the number of selected items you will get an out of bound error. OTOH I guess you already know that!!
Regards
|
|
|
|
|
Hi Thanks a lot.
Now ok.
But still i want to append the text in listview.
listView3.SelectedIndices = new Font("Arial", 10, FontStyle.Bold);
listView3.Items.Add(name + " : " +message);
listBox1.Items.Add("\n");
That one tried, but still notSupportedException coming..
please give your advise
Thanks&Regards
|
|
|
|
|
Hello
What I understand from your post is that you want to append some text at the end of each selected item in the listView.
First, let's we go through your code:
Sri harini wrote: listView3.SelectedIndices = new Font("Arial", 10, FontStyle.Bold);
Here you are assigning a font object to a collection of integers!! Not appropriate.
Sri harini wrote: listView3.Items.Add(name + " : " +message);
Assuming that message is a string, you are trying to add a string to a collection of ListViewItems! Again same problem
The last line is same as the second. So, your problem lies in not matching your types. You must know which type to use. Usually I keep my MSDN as long as I'm programming. It helps a lot
Now to do the same thing, I suggest this code:
foreach(int Index in listView3.SelectedIndices)
listView3.Items[Index].Text += ": " + message;
You can't change the font of items because it's not supported in compact framework -BTW: I revised MSDN for that;P-
I don't understand why would you add a newline to the end of your item's text?? But if you insist just uncomment the code I commented -after removing the semicolon of course-
Regards
|
|
|
|
|
Hai,
I am trying to add the .cs files to my project in the solution explorer using vs 2005 add-in. But i am not able to do so. Is there any way to do this. Can any one tell me how to create this add-in
Thank You in advance
Phanindra
-- modified at 2:51 Monday 28th August, 2006
Phanindra...
|
|
|
|
|
Hello
Phanindra Kumar wrote: I am trying to add the .cs files to my project in the solution explorer using vs 2005 add-in.
I don't think I got you right!! Are you trying to add a cs file to your project as a new Add-in project??
The way I know it is:
Solution Explorer => Right Click on Project's name => Add => Existing item
Regards
|
|
|
|
|
Hi!
Need your ideas urgently! I have a metafile which I wish to convert to PDF on the fly. The idea is to create a metafile template with placeholder text, which will be parsed and replaced by user information at runtime before generating the PDF. When editing the metafile, I have progressed to the following steps:
1. Called the Graphics.EnumerateMetaFile() method, which calls the callback method (lets call it ‘Play’)
2. Called the callback method and obtain the record data
public bool Play(EmfPlusRecordType recordType, int flags, int datasize, IntPtr data, PlayRecordCallback callback)
{
byte[] dataArray = null;
if (data != IntPtr.Zero)
{
dataArray = new byte[datasize];
Marshal.Copy(data, dataArray, 0, datasize);
}
3. Checked whether the record pertains to writing text on the wmf as follows:
if (recordType == EmfPlusRecordType.DrawString)
4. Called the Metafile.PlayRecord() method to draw the new metafile.
mf.PlayRecord(recordType, flags, datasize, dataArray);
What I’m unable to do is, to parse the dataarray (which contains record data), such that I can replace existing text with new text.
Thanks a LOT for any insights.
Regards,
Kunaal
|
|
|
|
|
Sir, I want to My Projects run any Computer default size.I try more but not a success.Please help me.Please Code provide me.
|
|
|
|
|
Could you elaborate on that?
I understand that you want to set the size of something, but I have no idea if you are talking about window size, font size, or whatever.
---
b { font-weight: normal; }
|
|
|
|
|
Hello
First of all welcome to CP.
Second, two things -among other things- are considered very rude here
1- Reposting your same question in the same forum within a short period even if you didn't get an answer on your previous post.
2- Cross posting questions in inappropriate forums.
So, please delete your previous message, and keep this one.
Now, to your issue. Please post the code that's troubling you, or in your case, more details about the size problem.
Regards
|
|
|
|
|
Sir, I want to My Projects run any Computer default size.I try more but not a success
|
|
|
|
|
What are you trying to say??
Please explain in detail.
Every is Illusion
|
|
|
|
|
The maskedTextBox control has the mask property, which set the default format of the text of this control. when the user haven't inputed any text in it, the text property of the control isn't "", the text of it is determined by the mask property of maskedTextBox control, and in my programm the mask property of the control is dynamic and changed by the condition. I need to judge if the user haven't input anything in this control. How can I do it?
mario dai
|
|
|
|
|
Hello
Try comparing the Text property with the Mask property
Regards
|
|
|
|
|
But when the mask property is "0000/00/00",the default text of this control is " / / /",they are not equal.
|
|
|
|
|
Hello
Two more approaches:
1- Check first character of text by IsChar() and IsDigit() methods to see if the user acually did make any input. You can also check the entire string using a forech loop.
2- Handle the TextChanged event, and store the updates in a bool called modified . Set it to true when the user makes input, and top false when the user deletes all characters.
Regards
|
|
|
|
|
Take a look at the IncludeLiterals property which will remove all formatting from the Text property, i.e. you will get the raw values entered by the user without any formatting provided by the mask property.
As of how to accomplish this, have you ever tried Google?
|
|
|
|
|
Hello
Looks like I've been a stray a bit with this one!!
The code should be like this, I think
maskedTextBox1.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
MessageBox.Show(maskedTextBox1.Text);
Regards
|
|
|
|
|
how can change shap to mouse cursor on mouse enter textbox ???
Palestine
|
|
|
|
|
Hello
You can do that using the TextBox.Cursor property.
Regards
|
|
|
|
|
When mouse move over webpage on the screen and stop on a word that is URL,how could I catch the URL from my program?
I hope you got my meaning.Thanks
August 12,2006,Rhythm of The Rain.
|
|
|
|
|
Hello
If you can access the source of the page, this is easy using javascript, or ASP.
On the other hand -which I think is your case-, if you can't do that, then the only thing I could think of is OCR (Optical Character Recognition). Yes, I guess I've gone too far, but some trnslation programs do that. When you point the cursor to a word and press the HotKey, the recognize the characters off the screen and tranlate them -if possible of course-.
This is way, way too advanced topic. You can get an image of the link easily using Graphics class methods, but interpreting the image to text will certainly need a library.
Regards
|
|
|
|
|
Hello,
I'm wondering how it's possible to create an application wide event that's fired when any keyboard or mouse key is pressed and mouse move?
Please help. Thanks
|
|
|
|
|
Look at the KeyPress and MouseMove events in the System.Windows.Forms namespace.
Deus caritas est
|
|
|
|
|
Hi
There are usually two ways to handle user inputs (keyboard/mouse).
If you like to hanlde those events in a form you can turn its keypreview property to true and override its OnKeyDown,OnKeyUp,OnMouseDown and etc. metohds to do what you want to do (or you can add a handler using event handlers)
But if you like to handle those events in an application rather than a form you can handle messages that are being send to your application by windows.
Regards
|
|
|
|