|
Well then, just find something else to do with your time. If it's not freakin' obvious what you have to do, and that "not wanting to" isn't a viable tack if you want to accomplish your goal, you shouldn't be a programmer. I bet you could find a job sweeping standing water off of sidewalks. Oh wait, that requires a little effort as well.
Oh wait! Try just staring off into space. That should keep your feeble excuse for a brain busy.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
You can use something like this:
foreach (Form frm in Application.OpenForms)
{
foreach (Control ctrl in frm.Controls)
MessageBox.Show(ctrl.Text);
}
This contains two foreach statement but indepedent of how many forms you have, you can get their controls.
zafer
|
|
|
|
|
You're right, but I have only one form, my form contains two Panels and each Panels contains some Controls.
Your foreach statements give me my Panels only.
Thanks
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Use two foreach statements. Like this:
foreach (Control oCtrl in this.Controls){
// Do something
foreach(Control oCtrl1 in oCtrl.Controls){
// Do something
}
}
"If you had to identify, in one word, the reason why the human race has not achieved, and never will achieve, its full potential, that word would be 'meetings'." - Dave Barry
|
|
|
|
|
It's possible only for two panels.
I wont be glad if i have 3 panels in my form and each one contains 4 panels inside...
however thanks.
While (true) { Human.isLearnable = true; }
|
|
|
|
|
In that case you can use conditional recursion by checking if current control has child controls.
"If you had to identify, in one word, the reason why the human race has not achieved, and never will achieve, its full potential, that word would be 'meetings'." - Dave Barry
|
|
|
|
|
Yeah, that's how I'd do it.
|
|
|
|
|
You guys are wasting your time. He probably thinks "recursion" is having to visit the toilet more than once in a 60-second time frame.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Each 'container' has it's own control collection so you have to loop each one of them. The most easiest way is to create a method for listing controls and call this method recursively passing the collection (for example List) as a parameter.
Pseudo-code would be something like:
GetControls(List controlList, Control parent) {
foreach (Control ctrl in parent.Controls) {
controlList.Add(ctrl);
GetControls(controlList, ctrl);
}
}
The need to optimize rises from a bad design
|
|
|
|
|
|
|
An unhandled exception of type 'System.StackOverflowException' occurred in me.
|
|
|
|
|
Sorry if I'm wasting your time...
I'm not an expert like you...
Yeah, I know Recursion, I'll use it...
Thanx
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Hey there,
I have a DataSet dsGalery among others containing the DataTable tblGalery in my program that I want to display in a DataGridview dgvGalery.
tblGalery contains 3 Columns:
1. ID (int)
2. Picture (System.Object) containing System.Drawing.Bitmap
3. Title (System.String)
when I set the Datasource of dgvGalery:
dgvGalery.DataSource = dsGalery.Tables["tblGalery"];
Everything is shown correctly except for the Images. Can anyone tell me how I can tell the second column in the DataGridView to display the Image?
thanx in advance
der gunnar
|
|
|
|
|
Hello. I am looking for a method of using files in C# that act similar to Databases (i.e. in tables) that will load successfully into Visual C# Express edition without having to have a seperate program to run the database. Preferably something simple like text files but allowing for better structure (like database tables).
Thanks.
|
|
|
|
|
u can use LINQ Method, in vs2008 & C#3.0...
|
|
|
|
|
You might want to look at SQL Server CE - which is a low footprint database that runs as a DLL in your application process space, i.e. no separate database to install.
|
|
|
|
|
Tried that. Asked below (see 'Connecting to a c# local datbase')
Didn't work too well (couldn't connect to it properly)
|
|
|
|
|
Well it does work, and is the solution for your problem. Try googling the msdn for a walkthrough.
|
|
|
|
|
You can use the WriteXml and ReadXml methods to save a DataTable as an xml file. That would give you at least the most basic fetures of a database with no installation needed.
Perhaps you should consider using an MS Access database? It's file based and the drivers come pre-installed with windows.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Try SQLite. It's free, fast, needs only one dll and has ado.net managed provider. System.Data.SQLite[^]
|
|
|
|
|
Thanks, Tried it before & didn't work but since discovered how to add the library. So I will try it again.
|
|
|
|
|
hi evreone
i have some question
1. how to make package that have inside FrameWork 2.0 and Uninstaller ?
2. how can i send control to class ?
thank's alot for any help
|
|
|
|
|
E_Gold wrote: 2. how can i send control to class ?
What do you mean? Talk more clear my friend...
While (true) { Human.isLearnable = true; }
|
|
|
|
|
i have ComboBox that i want to fill whit Database from dataset
the action for fill is in my class
i whant that in the main form i can wright ComboBox1.MyClassName.Fill(sql query)
is it posible ?
thank's alot
|
|
|
|