|
Hi,
Do you got a sample for me?
Thanks in advance!
|
|
|
|
|
something like:
if(this.txt1.InvokeRequiered){
Invoke(new MethodInvoker(delegate
{
this.txt1.Text = ComputedValue();
}));
Something like that.
[Edit]This example assumes that you created your working thread
from the UI thread[/Edit]modified on Sunday, February 28, 2010 12:50 PM
|
|
|
|
|
You can either disable cross thread exception or you can use delegates.
My advice, use delegates!
Cheer's,
Alex Manolescu.
|
|
|
|
|
Nice to here of you again. Now romanian stuff.
Ce mai zici?
N-ai m-ai raspuns. In ce parti ale tarii esti?
Oras. In ce domeniu(specific) lucri?
Back to english => I'm working on a System.Terror implementaion. Would anyone like
to help me in my effort?
It curently implements the ISpanihInquistion , LiquidNitrogen , AbsDoDoubtlyNitro and
many many others such as IDoublyDoubtAnything , ISuck , IPlz ,
IWantFerrari and so on.
[Edit]
And of course IForgatToMention that IAmInsane .
[/edit]
cheersmodified on Sunday, February 28, 2010 1:36 PM
|
|
|
|
|
Hi Mosule,
i've been busy with my work
i'll send you a pm.
cheers
|
|
|
|
|
I do pretty much the same as Moshu except I invoke the method again from within the method if required (recursion) and repass the parameters rather than hardcoding them.
private void SetText(Control control, string text)
{
if (InvokeRequired)
Invoke(new MethodInvoker(delegate { SetText(textBox, text); }));
else
control.Text = text;
}
|
|
|
|
|
Hi,
How do you make the control enter that method?
Shouldn't there be some sort of callback declared?
|
|
|
|
|
However you like, you can call that method from a callback if desired.
If you are wanting to handle an event from a different thread without calling another method then just match up to the event signature as you do in your event handler to invoke the handler on the correct thread.
Dave<br>
<font size="-1">Tip: <a href="http://www.codeproject.com/tips/55555/Pass-value-between-forms-using-events.aspx">Passing values between objects using events (C#)</a></font><br>
<font size="-2">BTW, in software, hope and pray is not a viable strategy. (<a href="http://www.codeproject.com/Members/Luc-Pattyn">Luc Pattyn</a>)<br>Why are you using VB6? Do you hate yourself? (<a href="http://www.codeproject.com/script/Membership/View.aspx?mid=6556">Christian Graus</a>)</font>
|
|
|
|
|
This[^] deals with it.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Thank you guys, it works! 
|
|
|
|
|
oracle uses a list of values component
i searched internet but i couldn't find anything similar in C# by the same name
is there other name for this component
any links or resources would be helpful
thanks in advance
excuse my bad language
|
|
|
|
|
Listbox[^]??Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
ListBox, ListView, DataGridView and this are just the standard components.
One nice custom control
|
|
|
|
|
I have a datagrid that is having values from a database. I need the values in the second column (being zero index based, i know if there is any indexing i will index as 1) but i am totally unable to get these items. i don't want to query the database again because this will slow down my system so much. please assist on how i can get this items.
I tried this but did not work:
ArrayList percentages = new ArrayList();
percentages.AddRange(dataGridInfo.Columns[1]); Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
If you need [Edit] to process [/Edit] them(the datas) in memory I would go for a List<YourClass> myList
and then set the datagrid.DataSource = myList;
Somethin like:
public ... GetDatas(){
cmd.CommandText = "SELECT * FROM XYZ";
SQLDataReader dr = cmd.ExecuteReader();
MyClass curr = null;
List<MyClass> lst = new List<MyClass>;
while(dr.Read()){
curr = new MyClass();
curr.Myprop1 = dr.GetString(0);
...
lst.Add(curr);
}
...
return lst;
}
var myList = GetDatas();
dataGridView1.DataSource = myList
Now you have the List and you can LINQ or whatever;modified on Sunday, February 28, 2010 11:35 AM
|
|
|
|
|
Is this the asp.net gridview of the winforms datagridview, 2 very different beasites.
Winforms you can use datagridview.columns[index] to get the column.Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Try this code sure it will help you
Label myLabel = (Label)myGridView.Rows[myGridView.SelectedIndex].Cells[2].FindControl("myLabel");
|
|
|
|
|
Hi all. I would like to add sliding panels like the ones in visual studio for tools. is there such a control? Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
did you search the CodeProject articles? there are several on the subject.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Here is the best link i have seen so far but i want to know if there exist a control for that.
http://www.codeproject.com/Messages/2663987/Re-panels.aspx[^]Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
When someone responds to your question, if you use the "Reply" on the message they post, then your message is added to theirs, and they get an email to say you have more information / further questions for them. Otherwise, you just have to wait and hope they see your new input - not guaranteed. You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:08am.
|
|
|
|
|
Thank you a million fold. You are super cool Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
hi
i was filling checkedListBox like this:
SQL = "select distinct TrapName,substr(TrapNum,1,4) from TrapTbl order by substr(TrapNum,1,4) ";
adp = new OracleDataAdapter(SQL, Conn);
dsView = new DataSet();
adp.Fill(dsView, "TrapTbl");
adp.Dispose();
this.ListAtar.DataSource = dsView.Tables[0];
this.ListAtar.DisplayMember = dsView.Tables[0].Columns[0].ColumnName;
this.ListAtar.ValueMember = dsView.Tables[0].Columns[1].ColumnName;
my question is, when i pick some items from the checkedListBox
and i press a button - how to get a list of the ID - the ValueMember ??
thank's in advance
|
|
|
|
|
you need to use ItemCheck event like this
private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
{
if (e.NewValue == CheckState.Checked)
{
Console.WriteLine(checkedListBox1.SelectedValue.ToString());
}
} Life's Like a mirror. Smile at it & it smiles back at you.- P Pligrim
|
|
|
|