|
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.
|
|
|
|
|
You asked this question yesterday[^]. People here respond on a volunteer basis, so you may not get a response in the timeframe you think is acceptable or desired.
Your question isn't very clear what you are actually trying to do. Are you trying to print files from the PDA to the printer from C# code? Or are you just generally trying to print a file?
In either case, you need to make sure that the printer is attached to your host computer and is working correctly. Can you print a test page? If not, I would suggest going to the manufacturers website for the printer and downloading the correct printer driver for your operating system.
You also need to make sure that the host computer is able to communicate with the PDA. This is generally done through the Microsoft ActiveSync software. If your host computer is able to "see" the PDA when it is connected, you should be able to access the file system on the PDA device and print the files.
If you need to do this through C# code, it is going to be more difficult.
Scott.
—In just two days, tomorrow will be yesterday.
—Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
[ Forum Guidelines] [ Articles] [ Blog]
|
|
|
|
|
first thank u to answer me :
second :I want to print a text I write in C# code (some lines like this eg.
materialName Quantity Price Value
myMAterialName 2 50 100 )
just like this I want to print
third : I have print a test page and the printer work with an embedded program in the WindowsCE.NET5.0 device is called BTPrinter but I can't print the text I want in it.
In other words I want to print the text I want in my program.
thank u again.
|
|
|
|