|
Presumably you are adding the textbox to some sort of UserControl object, right? Just refresh the control that contains the textbox (after the control is visible and the textbox has been added to it's children), and that may solve the problem.
-Jeff
|
|
|
|
|
when you say 'refresh' what do you mean? I do not have a refresh option available when I do this.
|
|
|
|
|
All things that inherit from type "System.Windows.Forms.Control" have a method, declared as "public void Refresh();". This method invalidates and repaints the control, so whatever the TextBox (which is a control, and therefore should have this method) is added to when you try to display it should have this method on it. Let me know if it works.
-Jeff
|
|
|
|
|
Hi Jeff!
Thanks for all your help and suggestions, I really appreaciate it!.
What I ended up doing was creating an item_Loaded event handler and placing the EnableEnditMode method call in the event handler, and then it started working!
I think you suggested that in one of your earlier posts but I didn't do it because the Isloaded for the item always said false so I figured adding an event handler was pointless.
Thanks again!
Bob
|
|
|
|
|
I want from data reader coloumn 2 data to MessageBox.But gettin error.!
string strBaglanti = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=ftakip.mdb";
// Baglanti nesnemiz:
OleDbConnection conBaglanti = new OleDbConnection(strBaglanti);
// Komutumuzu tanimlayalim
OleDbCommand cmdKayitEkle = new OleDbCommand();
// komutumuzun tipini ve ismini verelim:
cmdKayitEkle.CommandType = CommandType.Text;
cmdKayitEkle.CommandText = "SELECT F_NO FROM F_KAYIT" +
" WHERE F_NO = '1231'";
cmdKayitEkle.Connection = conBaglanti;
conBaglanti.Open();
OleDbDataReader dr = cmdKayitEkle.ExecuteReader();
while (dr.Read())
{
MessageBox.Show(dr[2].ToString());
}
dr.Close();
conBaglanti.Close();
}
|
|
|
|
|
Your command text only contains 1 column. How could you read from any other column? BTW - you should use GetOrdinal to find the ordinal position of this column, e.g. dr.GetString(dr.GetOrdinal("F_NO"));
|
|
|
|
|
Your query only returns 1 column. How can you reference a second column?
BTW, DataReader column indexers are zero-based. dr[2] actually returns the 3rd column.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Have you tried dr[1] ?
I don't remember how it was in C# but I think datareader's indexes begin in 0.
Hope it helps
rotter
|
|
|
|
|
i think i wrote something wrong.I dont mean to i want 2 Coloumn from data reader. I want SECOND Coloumn's data from data reader than write it with MessageBox.But i am getting an error like Data Type conflict.
|
|
|
|
|
Hi,
I have just switched from VS2003 to VS2008. I am using a repeater control on a web form.
When i try to personalise the control in HTML using
. I am getting a error for bgcolor!!
I think bgcolor has been superseded with something else? Can someone please tell me what i would need to do.....
Cheers
|
|
|
|
|
It is replaced by background-color css attribute
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Thanks Ennis Ray Lynch, Jr.
how would i use a css attribute?
e.g. if i wanted to have a blue background on a field name. Id use something like bgcolor=blue.
How to you do that with a css attribute??
Cheers
|
|
|
|
|
style="background-color:blue;"
|
|
|
|
|
Thanks Pete!
Cheers
|
|
|
|
|
I usually go to http://www.w3schools.com/xhtml/default.asp[^] when I need a reference for any sort of website useful languages. They also have very usable tutorials for things like perl, javascript, css, etc. Hope this helps you in the future!
-Jeff
|
|
|
|
|
thanks!
Cheers
|
|
|
|
|
Hi
How can i run a query which will check that there is _ in the field name?
cheers
|
|
|
|
|
You could try and use the IsPunctuation method to check for a '_'.
Cheers
|
|
|
|
|
hustler2005 wrote: You could try and use the IsPunctuation method to check for a '_'.
How does that answer the question
Read my response[^].
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Read the documentation[^] under the section 'Using Wildcards as Literals'.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
hi
i need it to work when running it in c# e.g.
string test0002 = "Select room_code from room_types where room_code like '_'";
but this doesnt work it seems to only look for a field called _ not containing this character??
any suggestions?
cheers
|
|
|
|
|
Did you read the documentation under the section I mentioned?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
I want to create a Reminder application (windows application using C#.net)which need to be started as soon as system gets boot up. To acheive this task I need to use windows service application but I think windows service application doesn't support GUI application So can any one plz help me out to find the solution.
My main requirement is:-
1. Application needs to be started as soon as computer started.
2. It should have a GUI.
If you know the solution then plz let me know ASAP.
Best Regards,
Chandan Kumar Gupta
|
|
|
|
|
Chandan_Kr wrote: I think windows service application doesn't support GUI application
It can. It's not good practice, but it can.
You could always put something in the startup folder to autostart.
|
|
|
|
|
I agree, you can get the path using this:
Environment.GetFolderPath(Environment.SpecialFolder.Startup); The first time you start the program (manually) you could make a shortcut to the application in this folder.
Matthew Butler
|
|
|
|