|
Thanks for the tip, I'd forgotten about passing data this way, I'm still rather new to this , and I was kind of stuck in a brain-dead Friday funk.
I implemented the change and it is working well now, thanks.
Cheers,
Lil Turtle
|
|
|
|
|
You can use anything that you would normally use to pass information between pages, without storing the information on the server. Query string, form data, cookies.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for getting back at me with the help, it's always appreciated to get guidance from one's contemporaries. As one fairly new to coding I'm grateful for the tips.
Cheers,
Lil Turtle
|
|
|
|
|
Hi all,
I'm trying to write an application to deal with email forwarding (in the sense of being invisible to the end user) to a list of 100+ email accounts. I am using Indy.Sockets and a SMTP server provided by Fasthosts (standard mailbox).
I am having trouble getting the SMTP message to deliver to the addresses contained within the 'Resent-To' header ('Resent-From', 'Resent-Date' and 'Resent-Message-Id' are also being included). I'm having to add the 'Resent-To' header via the Indy.Sockets.Message.ExtraHeaders.Add() method as else the 'Resent-To' header seems to break-out into the main email, which results in an incorrectly formatted email (half of the 'Resent-To' addresses are shown in the body with the remaining headers).
Can anyone possibly offer any help? Or have successfully sent emails using a 'Resent-To' header?
Many kind regards,
Ben Whorwood
|
|
|
|
|
Hello!
I am a beginner in UI programming with C#. My problem: I have a ListBox on
a Form, that shall automatically update its content, when the data source
has changed.
I can fire the DataSourceChanged event in the data source class (which is
a derived ArrayList class) and also catch it in the Forms class. But
when I do there a ListBoxInstance.Update() or ...Refresh() ... or
Invalidate(), it has no effect at all.
Maybe someone can give me a hint on what I did wrong?
Here is the interesting part of my source code:
Form1.cs:
private System.Windows.Forms.ListBox listBox1;<br />
private System.Windows.Forms.Button button1;<br />
<br />
private ItemList itemList = null;<br />
<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
<br />
itemList = new ItemList();<br />
<br />
itemList.Add(new Item(1,"One"));<br />
itemList.Add(new Item(2,"Two"));<br />
itemList.Add(new Item(3,"Three"));<br />
<br />
listBox1.DataSource = itemList;<br />
listBox1.DisplayMember = "Desc";<br />
<br />
itemList.eventHandler<br />
+= new EventHandler(listBox1_DataSourceChanged);<br />
}<br />
<br />
private void listBox1_DataSourceChanged(<br />
object sender, System.EventArgs e)<br />
{<br />
Console.Out.WriteLine("DataSource changed 2");<br />
<br />
listBox1.Refresh();
Rectangle rect = new Rectangle(new Point(0,0),listBox1.Size);<br />
listBox1.Invalidate(rect,true);
listBox1.Update();
}
Item.cs:
public class Item<br />
{<br />
private int nr;<br />
private string name;<br />
<br />
public Item(int a, string b)<br />
{<br />
nr = a;<br />
name = b;<br />
}<br />
<br />
public string Desc { get { return "Nr:" + nr + " Name=" + name; } }<br />
}<br />
ItemList.cs:
public class ItemList : ArrayList<br />
{<br />
public EventHandler eventHandler = null;<br />
<br />
public ItemList()<br />
{<br />
}<br />
<br />
public void Remove(Item item)<br />
{<br />
Console.Out.WriteLine("Soll loeschen: " + item.Desc);<br />
base.Remove(item);<br />
FireDataChanged();<br />
}<br />
<br />
public void Add(Item item)<br />
{<br />
Console.Out.WriteLine("Soll adden: " + item.Desc);<br />
base.Add(item);<br />
FireDataChanged();<br />
}<br />
<br />
private void FireDataChanged()<br />
{<br />
<br />
if (eventHandler != null)<br />
{<br />
eventHandler(this,null);<br />
}<br />
}<br />
}
When I call the methods Add or Remove in ItemList, the event is fired,
I can see the Console.out.WriteLine-Message, but the ListBox is not
updated...
Thanks for help
|
|
|
|
|
DataSource to null and then reassigning it works.
listBox1.DataSource = null;
listBox1.DataSource = itemList;
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
It's not a Visual Studio bug, this behavior is seen at runtime. It's not a bug at all, really. ArrayList doesn't implement IBindingList, which is the interface used by the WinForms databinding infrastructure to propogate change notifications from a data source to a control. The methods that CSharper2006 was calling on the ListBox have no effect on syncing the control with the data source. If you really want automatic change noticiations to propogate, use a data source which implements IBindingList.
:josh:
My WPF Blog[^]
|
|
|
|
|
So in his case he could just implement IBindingList in his ItemList class.
On second thought, that interface has a lot of methods!
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I'm trying to write a program (C# .NET 2003) for use in my school, and so far it works pretty good.
The biggest problem I am having is that when I call MessageBox.Show(), no text shows up anywhere in the textbox, ncluding the title and OK button. This didn't use to occur, and then only on some computers, and now on every computer it is used on (including the design computer)
My computers have all of the Microsoft Updates, so I figured uninstalling .NET Framework 2.0 might help, but it was no good.
Here's my code if that helps:
MessageBox.Show(this, "MyStorage (C) 2006 IT Academy", "About MyStorage", System.Windows.Forms.MessageBoxButtons.OK);
MessageBox.Show("This should show something");
Neither of those work. The message box shows, and is perfectly functional, there is just no text.
If anyone can help, I would greatly appreciate it. I have to have this project finished by the end of this month, and this is my only real issue.
Thanks a lot
using System.People;
Person me = new Person();
me.Certifications = null;
me.Experience = little;
me.WantsToLearn = true;
me.InSchool = true;
me.AskQuestions("C# .NET 2003");
|
|
|
|
|
Try this:
string message = "MyStorage (C) 2006 IT Academy";
string caption = "About MyStorage";
MessageBoxButtons buttons = MessageBoxButtons.OK;
MessageBox.Show(this, message, caption, bttons);
Best,
Jun
|
|
|
|
|
Hmm.....
The title shows up now, but there is still no text for the message, and there is no text on the button...
Thanks, though. I'll keep trying.
using System.People;
Person me = new Person();
me.Certifications = null;
me.Experience = little;
me.WantsToLearn = true;
me.InSchool = true;
me.AskQuestions("C# .NET 2003");
|
|
|
|
|
I'd buy a new computer, with a new copy of Windows, and a new copy of Visual Studio. You got something funky happening and it ain't code.
Try code model generation tools at BoneSoft.com.
|
|
|
|
|
It sounds like you might have a virus or something really evil in your machines (perhaps Satan has inhabited your hard disk). Reformat the machine, if you have the time.
:josh:
My WPF Blog[^]
|
|
|
|
|
I have a feeling that there is no virus or anything like that.
We've tried running it on some brand new computers, and it still doesn't work.
I have a feeling that there's something wrong with my project settings or something. I'll keep looking.
If anyone has any additional info, I'd really appreciate it.
Thanks.
using System.People;
Person me = new Person();
me.Certifications = null;
me.Experience = little;
me.WantsToLearn = true;
me.InSchool = true;
me.AskQuestions("C# .NET 2003");
-- modified at 15:16 Friday 7th July, 2006
|
|
|
|
|
Greetings:
This happen`s on all your project`s or only on this one?. Try creating another project and try on that one MessageBox.Show("test") , just to know if it`s something in your code or whith visual studio.
"Failure is the best reason to start all over again with more knowledge"
-Henry Ford
|
|
|
|
|
This happens on all projects, and on all machines with Visual Studio.
Due to the previous "random" nature of whether or not it worked on seperate machines, I believe it has something to do with a Windows Update, because we push out updates here through WSUS.
That would explain why some computer showed the text, and some didn't; and now none work.
Soo.... anyone have any idea of any Windows or Microsoft Updates that would cause such a problem?
using System.People;
Person me = new Person();
me.Certifications = null;
me.Experience = little;
me.WantsToLearn = true;
me.InSchool = true;
me.AskQuestions("C# .NET 2003");
|
|
|
|
|
Greetings:
That`s really strange, i have all of the windows updates, and never had this problem, i really dont know what could be the problem, one workaround could be to create another form in the application that serves as the message box, then you could just pass the text to display to it and show it, something like this:
FormM temp=new FormM();
temp.setText("blabla","blabla");
temp.ShowDialog();
public void setText(string x1,string x2)
{
this.Text=x2;
label1.Text=x1;
}
hope that helps until you fix the problem
"Failure is the best reason to start all over agin with more knowledge"
-Henry Ford.
-- modified at 17:16 Friday 7th July, 2006
|
|
|
|
|
I actually had this happen to me as well - are you by any chance runnin McAfee? If so this could be the problem...McAfee has a patch. Check out McAfee web site item http://forums.mcafeehelp.com/viewtopic.php?t=32979[^]
If you are not running McAfee then obviously this isn't this issue but I thought it was worth mentioning
cje
|
|
|
|
|
Thanks a lot! That actually worked.
It took us a whil;e to find the patch, but we managed to download and install Patch 11. We were only at patch level 1. O_o
Thanks.
using System.People;
Person me = new Person();
me.Certifications = null;
me.Experience = little;
me.WantsToLearn = true;
me.InSchool = true;
me.AskQuestions("C# .NET 2003");
|
|
|
|
|
Wow, that's pretty sickening. No wonder I don't use that McAfee crap.
Logifusion[^]
|
|
|
|
|
Hi All,
I got a problem where I want to draw some lines on a Map(JPEG, BMP, GIF), and data for these lines are in Latitude and logitude form. I have some idea that I can do it by Drawing object(GDI object), but converting latitude and longitude data into pixels might be error prone.
Can anybody help me ?
Is there any efficient way for doing it ?
Please let me know.
Thanks
Sandeep
|
|
|
|
|
We had some good discussion about lat/lon to distance conversion around this article.
Search CP for "GPS" and you can get more.
Best,
Jun
|
|
|
|
|
I suggest you become very familier with coordinate systems as you attempting to plot a coordinate system designed for a 3D sphere (ish) onto a 2D image. There are so many approaches depending on what you know about the image(s) that you need to study them all. Drawing a black blob on the image is the least of your worries.
I'll be more enthusiastic about encouraging thinking outside the box when there's evidence of any thinking going on inside it. - pTerrywww.many-monkeys.com
|
|
|
|
|
I am developing a Save method in my business Process that allows me to Save the current object (scheme) and all it child collection objects, so that all I need to do is call bp.Save(Scheme) and it saves via reflection the entire tree.
I have a class "Scheme" which contains as properties a number of ReadOnlyCollections e.g. ReadOnlyCollections<milestone> and ReadOnlyCollections<partner>.
"Milestone", "Partner" and "Scheme" have a "Save" method and inherit from the same object (hcdbEntity).
I want use Reflection to call the "Save" method on the Scheme and each Milestone in the collection(becuase I have many other collections hanging off Scheme and Milestone) and don't want to hard code.
When I view the property info for the scheme I have to check for contains "ReadOnlyCollection" as the property.PropertyName holds "ReadOnlyCollection'1".
property.PropertyType = {Name = "ReadOnlyCollection`1" FullName = "System.Collections.ObjectModel.ReadOnlyCollection`1[[Business.Entity.Scheme.SchemeMilestone, Business.Entity.Scheme, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]"}
The currentValue that gets returned by calling the Invoke method returns a list of the seperate items in the collection, but gives me no way to process them individually, or get a handle on them to call the Invoke method to call their Save method, or to be able to transverse down the tree to call collections further down as required.
private void DoA(HcdbEntityClass entity)
{
Type t = null;
System.Reflection.PropertyInfo[] properties;
object currentValue = null;
t = entity.GetType();
properties = t.GetProperties();
foreach (PropertyInfo property in properties)
{
Type a = property.GetType();
if (property.PropertyType.Name.Contains("ReadOnlyCollection"))
{
currentValue = t.InvokeMember(property.Name, BindingFlags.GetProperty, null, entity, new object[0], CultureInfo.CurrentCulture);
}
}
}
I am assuming that I need to return a object and use the generic.MakeGenericType to regenerate the collection type for the object. I have spent more than a day trying without sucesss, anybody done this sort of thing before and have a small sample;), or am what I am doing impossible.
nearly bald
Satvinder
|
|
|
|
|
Have you considered serialization rather than reflecting through your objects?
|
|
|
|
|