|
George_George wrote: InitializeComponent
This is always where auto generated code lives, you should not modify it if you can help it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Do we need to modify code for this method? Which party will invoke this method?
regards,
George
|
|
|
|
|
As Christian said, you don't need to modify it. Its just the designer code, so for example, if you drop a textBox on a form, all it's initialisations will go there such as it's size, location, name etc...
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Thanks Phannon,
Your reply is great! I think you mean this method will be maintained by designer (for example, if we add new Timer control, designer will add initialization code for Timer control in this method).
If we want any initialization code, we should put in constructor, right?
regards,
George
|
|
|
|
|
George_George wrote: Which party will invoke this method?
As CG said, it is auto generated. In windows application, controls will be initialized and added to the container in this method. This will be called from the constructor. In service you don't need this since you are not using any components like Timer etc. If you are using components like Timer, you can make use of this method to initialize the component and add it to the components collection which is IContainer instance. This helps the application to dispose the components used when service is getting disposed.
Hope this helps
|
|
|
|
|
|
George_George wrote: Do you think my understanding here is correct?
Yes.
George_George wrote: If we want any initialization code, we should put in constructor, right?
You can put the initialization code anywhere before the instance is used.
|
|
|
|
|
Cool, N a v a n e e t h!
Question answered.
regards,
George
|
|
|
|
|
hi,
for send Tab key >>> SendKeys.Send("\t");
but i want to know, how may I send BACK TAB which we usually use in form's textbox like "SHIFT+TAB"
SendKeys.Send(?????)
Thank you in advance
|
|
|
|
|
I guess for shift + tab its
Sendkeys.send("+{TAB}")
For Alt + tab its
Sendkeys.send("%{TAB}")
My idea of ideal life : Eat, Sleep, Repeat
|
|
|
|
|
Hi Guys. Hope you all had a great weekend.
I want to impliment some further validation on a textbox in one of my applications. I currently only check that the .TextLength is 11 characters and if not to throw an error message. Now, I wan to take it one step further by checking that first character is a specific character say, A or B and if not to throw an error.
i.e I want to check that the first character in A0812345678 is an A or B. If not then then throw error.
Can somebody please help with this?
Below the check to see if it is 11characters long:
if (txtboxHolderRef.TextLength < 11 || txtboxHolderRef.TextLength > 11)
{
MessageBox.Show("HolderID should be 11 characters" , "Invalid Field Length",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
|
|
|
|
|
Urm... how about myString.StartsWith("some string"); ??
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Why would you throw an error ?
|| (txtBoxHolderRef[0] != 'A' && txtBoxHolderRef[0] != 'B')
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Why would you throw an error ?
Hi Christian. Because If they don't capture the data correctly I want to error rather than let them capture incorrect data. I need to process this data into the main system at a leter stage and getting the data correct when they capture it reduces any manual fixing later.
I will give your suggestion a go and see what happenes.
Thanks for the advice again.
|
|
|
|
|
I meant I'd show the user a message, not throw an error
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
^[abAB]{1}.*$ This expression matches with all the words starting with a and b. Use this pattern with Regex class and check for a match. If no match found, throw an error. Also you may check this[^] article which explain writing rules to your business objects and binding the error provider to the control. It can make life more easy.
|
|
|
|
|
if (!txtboxHolderRef.Text.Lenght.Equals(11))
{
throw your error and return
}
else
{
String StartLetter = txtboxHolderRef.Text.Substring(1,1)
switch (StartLetter)
{
case "A": do something; break;
case "B": do some other thing; break;
default: break;
}
}
|
|
|
|
|
Hello,
I am coping contents of DataReader in to ArrayList and bind this ArrayList to dropdownlist1.Now i want to remove the item from my arraylist which has been selected by dropdownlist1,after deleting d item i want to bind the updated arraylist to the another dropdownlist and so on. My code looks like following....
item = new ArrayList();
conn.Open();
string qitem = " SELECT DESCRIPION FROM ITEM_MASTER ORDER BY DESCRIPION";
OracleCommand ocmd = new OracleCommand(qitem, conn);
OracleDataReader odr = ocmd.ExecuteReader();
if (odr.HasRows)
{
while (odr.Read())
{
item.Add(odr.GetString(0));
}
}
odr.Close();
conn.Close();
bind_control(ddl_mainItem, item);
Now i want to delete item selected by ddl_mainItem.What can I do?
Plz help me.....
|
|
|
|
|
Why are you still using .NET 1.1, and if you're not, why are you using arraylist ?
The List class certainly has an items collection which has a remove method, I believe ArrayList does, too.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
i'm Merging To DataTables Into 1
They are in same format , so far so good it's Doing it well
But When i'm trying to Update To The DataBase Nothing is Actually Done
No Saving of the Data.
This Is The Code :
<br />
dS_M_ICD.Interface_Details.Merge(dS_E_ICD.Interface_Details, true);<br />
<br />
M_Interface_D.Update(dS_M_ICD.Interface_Details);<br />
dS_M_ICD.Interface_Details.AcceptChanges();<br />
<br />
Have Fun
Never forget it
|
|
|
|
|
i want to apply the encription and decription on my data files by using c#. how can i do this in c#
|
|
|
|
|
The Cryptography namespace is full of algorithms you can use, and google abounds with examples on how to use them
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
How to retrieve records from Excel Sheet..Its working fine when i have a column name in the Excel sheet, if suppose i didnt have the column name. i have to retrive record in the basis of column index..how can i acheive this one.. im using C#.net 2003..
Regards
Kanna
|
|
|
|
|
Hello!
I´ve got this regular expression:
Regex.Replace(amount.Value.ToString(), @"(?<=^-?\d+)(?=\d{3}$)", ".")
it takes a value and returns it formated like this:
1 -> 1<br />
12 -> 12<br />
123 -> 123<br />
1234 -> 1.234<br />
12345 -> 12.345<br />
123456 -> 123.456
problem arises when number of digits are above 6, the code then returns
1234567 -> 1234.567
whereas I would want it to return
1234567 -> 1.234.567 and 12.345.678, 123.456.789 etc.
I realize the '$' character´s got go , since it means end of string, but if I remove it I get really strange results.
Could someone help me alter the expression to achive this?
modified on Monday, April 14, 2008 5:23 AM
|
|
|
|
|
An easier way to do this would be to just do it using string mashing. Or using string.Format to do decimal formatting for you.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|