|
The first step is to figure out where the null reference error is happening.
Why not put a break-point at the entry to the Updatebutton_Click EventHandler code, and single-step through the code until you find the error.
If you call the 'ToString method on a ComboBox's SelectedValue when there is no value selected, you will get a null reference error: that's one of the possible sources of error to evaluate.
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.
Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
|
|
|
|
|
Try debugging your code when this type of error occurs. This generally happens when you access a property or method of an object that itself is null.
|
|
|
|
|
How can i detect an xbee if its connected to computer or not via USB ? and get notification if its connected or not
|
|
|
|
|
I usually first listen to the sound of the computer and verify there is a humming.
Then I place a tea-spoonful of honey in an open dish near the computer and listen to see if there is a change in the pitch of the humming.
If that doesn't work, I use Google to locate two CodeProject articles in the top three search results returned by: [^], and start writing code while trying not to think of dead bees.
good luck, Bill
"What Turing gave us for the first time (and without Turing you just couldn't do any of this) is he gave us a way of thinking about and taking seriously and thinking in a disciplined way about phenomena that have, as I like to say, trillions of moving parts.
Until the late 20th century, nobody knew how to take seriously a machine with a trillion moving parts. It's just mind-boggling." Daniel C. Dennett
|
|
|
|
|
BillWoodruff wrote: start writing code while trying not to think of dead bees For the pure Monty Python that put in my mind, I award you the Order of Pete - it's a shiny badge of honour that you should wear with pride. To get your copy, simply print our your reputation page and look for the points that corresponds to the 5 and cut it out. Wear it with pride my friend.
|
|
|
|
|
|
|
Hello All,
On my project I want to change file and folder default icon same as dropbox. I have already made some Google and get a solution using vc++ but I don't have any experience on vc++ for that reason I am not able to apply this on my project.
So my request to you please suggest me, how can I do the same using C# ? I am familiar on C# language.
Please share with me me your valuable experience on this point. I am waiting for your valuable reply.
Thanks in advanced,
Tapas
|
|
|
|
|
If you added C# to your Google search terms, or had done the search inside CP itself, you might have ended up here[^]. Make sure to read the comments as well.
|
|
|
|
|
You beat me by seconds.
Veni, vidi, abiit domum
|
|
|
|
|
|
Thanks Richard for your valuable response.
I have already applied it and it working fine for folder icon change. But it not working for file icon change.
So please suggest me for file icon change.
Thanks once again,
Tapas
|
|
|
|
|
|
Thanks Richard once again,
Its not same that I am expecting. Actually I am trying to find a file icon overlay same as Dropbox/Tortorise SVN working folder.
Please give me some alternate solution.
Thanks,
Tapas
|
|
|
|
|
Tapas Saha wrote: I am trying to find Then Google is the tool of choice.
Veni, vidi, abiit domum
|
|
|
|
|
Why? Microsoft is actively discouraging the use of icon overlays.
|
|
|
|
|
Well, "...I want to change file and folder default icon same as dropbox..." what it means?
What is your dropbox? There is no answer if you suggest your problem clearly.
|
|
|
|
|
Hello WuRunZhe,
Thanks for your reply.
Actually on dropbox after sync new file and folder a green trick mark added on file and folder icon. I want something like that.
Please suggest...
|
|
|
|
|
I have 2 forms --> Form1 and Form2
Both contain a textbox(textbox1).
Form2 have a button. When I click on that button i want to take the text from Form2.textbox and paste it into Form1.textbox.
How to do that?
Thanks.
|
|
|
|
|
You have not done even the minimum research on this one. Have some Google Foo[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I knew your brother, Sherlock.
the solution was interesting but none of you give it right.
I give you the credits because you suggested what to search for ... but you did not helped.
The solution:
public partial class Form1 : Form
{
Form2 f2;
public Form1()
{
InitializeComponent();
f2 = new Form2();
}
private void button1_Click(object sender, EventArgs e)
{
f2.firstValue = textBox1.Text;
f2.ShowDialog();
label1.Text = f2.secondValue;
}
}
public partial class Form2 : Form
{
public Form2() {InitializeComponent();}
public string firstValue,secondValue;
private void Form2_Load(object sender, EventArgs e)
{
label1.Text = "Welcome " + firstValue;
}
private void button1Build_Click(object sender, EventArgs e)
{
secondValue = textBox1.Text;
this.Hide();
}
}
|
|
|
|
|
f2.ShowDialog();
I just tried a similar test and the second form shows just fine.
Veni, vidi, abiit domum
|
|
|
|
|
f2.Show(); well, maybe in THIS particular case is NOT suppose to work.
i dont know and i dont care - i solved my problem. lol
|
|
|
|
|
Please don't do that - making your fields public is a very bad idea: use properties instead.
And the Show does work - but you probably don't understand the difference between Show and ShowDialog.
f2.firstValue = textBox1.Text;
f2.ShowDialog();
label1.Text = f2.secondValue;
Waits until the Form2 instance is closed before executing the following line.
f2.firstValue = textBox1.Text;
f2.Show();
label1.Text = f2.secondValue;
Returns immediately and executes the following line straight away, before your user has any chance to type a new value.
|
|
|
|
|
Ohooo, my Christmas is coming early for me - Now, that is a real helpful answer - you should be proud.
I am. And i thank you for clearing it up.
The global var, is the best thing to do because they are not using much space (like the properties does with a lot of script - get then set, not good for the coder at all). Maybe they(properties) are good in some VERY particular(i dont really know them) cases but not in all. I think with global var you maintain a lighter and easier code.
|
|
|
|