|
of course that should work. and so would a List<Annotation> as has been said earlier. I suggest you read up on the List class and some generic stuff, it is really powerful, and you can use it as an array (and more).
|
|
|
|
|
[Edited to clarify my rubbish English]
The problem is, judging from your code, m_ChartControl.Charts[0].AnnotationList.CreateAnnotation(); creates an individual annotation not a collection of annotations. This is causing the error you are getting.
In my earlier post, List<Annotation> is IEnumerable , and it shows you how to add individual annotations.
The problem you are experiencing in getting an answer here is because what you asked for in your original post is highly unusual in c# (though possible in laguages that follow a different paradigm). The normal c# practise is to create a in instance of a collection type such as list, array or collection (or their generic equivalents which are better) and add objects to the collection (rather than trying to create paremeters for each). You can the iterate over the collection as required.
What is the reason for trying to create a parameter-per-annotation?
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
What is it you're foreach ing?
|
|
|
|
|
well..
basically this is wat i am foreaching
public void AddAnnotations()
{
string toa = "calls";
while (true)
{
XmlDocument xmlPlogs = getAllPlogs(toa);
XmlNodeList plogs = xmlPlogs.SelectNodes("/PlogList/Plog");
Annotation[] anno = null;
int countA = 0;
int arrayIndex = 0;
foreach (XmlNode plog in plogs)
{
XmlNodeList receivers = plog.SelectNodes("PlogUnique/Message/Receiver");
foreach (DateTime dt in dateArray)
{
DateTime newDT = Convert.ToDateTime(plog.SelectSingleNode("PlogCommon/TimeOfOccurrence").InnerText);
newDT = Convert.ToDateTime(newDT.ToString("dd MMM"));
String content = plog.SelectSingleNode("PlogUnique/Message/Content").InnerText;
if((content.Contains(stockQuote)) && (newDT.ToString() == dt.ToString()))
{
for (int i = 0; i < dateArray.Length; i++)
{
if (dateArray[i] == newDT)
{
arrayIndex = i;
}
}
anno[countA] = m_ChartControl.Charts[0].AnnotationList.CreateAnnotation();
anno[countA].Location.TypeX = LengthType.Bound;
anno[countA].Location.X = arrayIndex;
anno[countA].Location.TypeY = LengthType.Bound;
anno[countA].Location.Y = 0;
anno[countA].Data = " ";
anno[countA].Font.Size = 4;
anno[countA].Font.Bold = false;
anno[countA].Color = Color.FromArgb(1, 1, 1);
modulePath = this.GetType().Module.FullyQualifiedName;
moduleDir = Path.GetDirectoryName(modulePath);
anno[countA].ImageFile = Path.Combine(moduleDir, "ArrUp.png");
countA++;
}
}
}
Thread.Sleep(5 * 60 * 1000);
ResetChart();
}
}
|
|
|
|
|
I want a program in the C # language to automate pharmacy I respond to
goldenman2424@yahoo.com
Iwait reply..................
|
|
|
|
|
Apologies, but I'm voting to remove this message even though it isn't "abusive" as such.
You have given someone's e-mail and spam-bots might pick it up. You should e-mail this guy directly if you need to contact him.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
It sounds like you need to look here: Rentacoder[^]
P.S.: Don't include your email in any post; not unless your really like spam!
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
I want two Boeing 787, a black one and a red one.
|
|
|
|
|
|
Post your address and credit card details (for security and identification purposes only, natch) - I'll sent them by return.
BTW I am the son of a Nigerian finance minister, and you may be able to help me...
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
No thanks, Nigerian Boeings don't take the local petrol kindly. And besides, Nigeria doesn't have any 787s.
|
|
|
|
|
Luc Pattyn wrote: Nigeria doesn't have any 787s
Well of course not! They are still far too heavy!
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
|
I don't want just ANY Boeing - I want this one.
But fortunately we have the nanny-state politicians who can step in to protect us poor stupid consumers, most of whom would not know a JVM from a frozen chicken. Bruce Pierson Because programming is an art, not a science. Marc Clifton I gave up when I couldn't spell "egg". Justine Allen
|
|
|
|
|
Nah. Maintenance requirements are too high.
|
|
|
|
|
Why not just try Rent a Coder?
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Aiham2424 wrote: Iwait reply..................
And that reply would be a resounding "NO!"
Write your own pharmacy app. Why should anyone give over their heard work to you so you can sell it as your own and take credit for it?
|
|
|
|
|
Hi
I need to insert some HTML-styled text into a Word 2007 document. As far as I know you cannot directly insert HTML into Word, because it needs to be converted first. So I save the HTML as a temporary file and use InsertRange to insert it into my document.
Here is my code:
string TempFileSaveDir = "c:\\word";
private void InsertHTML(Document pDoc, string pHTML)
{
Guid _guid = Guid.NewGuid();
string _fileName = TempFileSaveDir + "\\" + _guid.ToString() + ".html";
TextWriter tw = new StreamWriter(_fileName, false, Encoding.UTF8);
tw.Write(pHTML);
tw.Close();
object start = 0;
object end = 0;
object ConfirmConversions = false;
object Link = false;
object Attachment = false;
object missing = System.Type.Missing;
Word.Range _range1 = pDoc.Range(ref start, ref end);
_range1.InsertFile(_fileName, ref missing, ref ConfirmConversions, ref Link, ref Attachment);
File.Delete(_fileName);
}
Now my problem is, that Word sees it as regular text rather than HTML, so if I have <b>Some Text</b> in my HTML it'll show the B tags instead of bolded text.
I noticed that when I set ConfirmConversions to true I get a popup, where I can select the HTML conversion. Is there a way to have the converter automaticly use this conversion without prompting the user every time?
Regards
|
|
|
|
|
This looks like a word for word copy of a post on the Microsoft Forums a month back, and is now cross-posted to 'Quick Answers' here[^].
The Microsoft forum post is here[^]
Is there a problem with the solution suggested on that forum?
|
|
|
|
|
|
That's not easy to do; applications shouldn't hijack the entire computer just to ask the user a question.
Perhaps you could create your own desktop[^], and display the form there
I are Troll
|
|
|
|
|
I'm sure if you google for a c# shutdown dialog, you get something.
You don't seriously expect us to provide you with the code, I've had a look at your message history, and you have a habit of doing this, or asking trivial questions that can be answered with a simple search.
I suggest you try something, then let us know what went wrong specifically, this is not a website where people just do your work for you.
[Edit]
Also see Eddie's answer, which he posted when I was writing this.
modified on Thursday, December 10, 2009 10:16 AM
|
|
|
|
|
System Modal dialogs do not exist in Windows NT and above. They only existed in Windows 9x and below.
Don't try to tell me that this isn't true and point to the shutdown dialog. That's not a system modal dialog.
|
|
|
|
|
|
There are classes and libraries that can do this and make it look different, but I think what your asking about is how to make a WPF app (Windows Presentation Foundation). That requires .NET 3.0 or above and a considerable rewrite of your application, since WPF doesn't work anything like Windows Forms.
|
|
|
|