|
Thanks Scott lot!
Just now im in the website u given , i'll go through this more and found some helpful samples too!.
scott i really appreciate you being so helpful. thanks .
so much of happy ending...
|
|
|
|
|
I'm very new to C sharp, having come from a c++ and vb background.
Within VS2005, I have a script (MainForm.Designer.cs) that defines all the components in my project (mostly toolstripmenus, buttons, labels, comboboxes etc.), the events attached to them etc
However, every time I try to group the code into logical blocks (including using regions) and save it, when I re-open VS mixes it all up again. I've gone through the help and even tried MSDN, but haven't found a way around this.
Anyone got any ideas?
Thanks in Advance,
John.
|
|
|
|
|
Hi,
all .Designer.cs files are generated automatically by Visual Designer;
you are not supposed to modify them in any way other than through the Designer.
So you should put your own code in one or more separate files.
|
|
|
|
|
Thanks Luc,
Just so I understand correctly, are you suggesting that I put the code from the designer script into my own script and simply call the functions from the designer script?
Best,
John.
|
|
|
|
|
why would you do any of that?
Leave the Designer code as is, where it is; the .Designer.cs files are part of your
project, they will be included in all your builds.
And there is nothing to call except for InitializeComponent(), which should be called
as the first statement in your form's constructor (the wizzard will have put it there
for you too).
|
|
|
|
|
You'll notice that your MainForm.cs and MainForm.Designer.cs both have:
public partial class MainForm
within the same namespace.
The designer file is handled by the IDE and automatically updated everytime design changes are made (this can include project opening etc).
You shouldn't normally make any changes to the designer file yourself. Your own 'functions' and calls to them should be added in the MainForm.cs file, or alternatively create your own MainForm.Functions.cs and/or MainForm.FunctionCalls.cs file and start these files with the namespace required and the public partial class MainForm { .... }
|
|
|
|
|
jgrogan wrote: are you suggesting that I put the code from the designer script into my own script and simply call the functions from the designer script?
No, leave them as they are.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Please help me.
How can we know wheather a user entered text in text box is in correct date format(dd/mm/yyyy). i want to show an error message when entered text is not in correctdate(dd/mm/yyyy) format.please send solution to me .thank you in advance.
|
|
|
|
|
|
use try{cast text to date}/catch (InvalidCastException ){here do what do u want}
|
|
|
|
|
I'm glad you got good answers for your question, however next time, I suggest you use more helpful subject for your posts.
Cheers,
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
use DateTime.Parse() or DateTime.ParseExact().
|
|
|
|
|
Use a more useful subject line next time
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Don't give the option to enter the date by user.
Give the option to select the date from the calender.
Display a popup calender and select the date from it.
Make the textfield for the date to be "readonly".
dhans
|
|
|
|
|
Hi Friends,
I am using datagridviewcheckbox column in datagridview. I have a probelm for clicking checkbox column. The problem is, On datagrid_CellMouseClick event, for clicking checkbox when getting value(selected/not selected) for checkbox column for this event. The checkbox value is null. How can i get checkbox value(selected/not selected) using datagridview?
Thanks in advance
Rameshkumar Thirumalaisamy
|
|
|
|
|
|
please who u can use datagridview in WindowsCE alpplication I search 4 it alot but I don't find. I usually use datagrid and who u use checkbox in it.
I answered with a question (like politicals) sorry but please help me.
|
|
|
|
|
Okay what I'm trying to do is use the Dialog window to have the user find an Excel Database file (xls extension). I have searched Google, Msdn and the site.
Error:
Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process.
Code where OpenFileDialog is created:
<br />
private void import_db(object sender, EventArgs e)<br />
{<br />
OpenFileDialog search_for_file = new OpenFileDialog();<br />
search_for_file.AddExtension = true;<br />
search_for_file.CheckFileExists = true;<br />
search_for_file.DefaultExt = "xls";<br />
search_for_file.Multiselect = false;<br />
DialogResult result = search_for_file.ShowDialog();<br />
<br />
string file_name = search_for_file.FileName;<br />
}<br />
It throws the error when I get to the ShowDialog method.
|
|
|
|
|
Dumb question: Does you Main function have a STAThread attribute?
[STAThread]<br />
public static void Main(string[] args)<br />
{<br />
...<br />
}
|
|
|
|
|
If you mean "Did I put [STAThread] before your main function?" then no. I assume that that will fix the problem.
*Edit*
Yes that did it, Thanks.
|
|
|
|
|
I have a table named STAFF contains fields like STAFFID, FULLNAME, BIRTHDAY, SEX, PHOTO. I use BindingSource to update database. Initially, when I have no PHOTO field, updating database is successful. After that, when I add PHOTO field into STAFF table, the failure of updating database is due to having a following error
"The query processor could not produce a query plan from the optimizer because a query cannot update a text, ntext, or image column and a clustering key at the same time."
I have searched all helps but no article mentions it. Please kindly help me solve this error.
Thanks in advance.
It seem to be a solution or an answer.
|
|
|
|
|
|
Check into the sql query where u have given the new DBfield for updating
dhans
|
|
|
|
|
give us the sql query and code. so that we will check it and will say
dhans
|
|
|
|
|
Please help me
I want to print some things using a Mobile Pro Spectrum printer from an Optimus_PDA device. I work in c# .NET2005 please help me I want the correct dll I had Downloaded alot of them but it doesn't working .
So if some one help me by send me the correct dll or give ma an example I will be very thankful for him/her.
Bye Merry Christmas.
|
|
|
|