Click here to Skip to main content
15,889,335 members
Home / Discussions / C#
   

C#

 
Questionconvert from Timespan to int ?? Pin
Mr.Kode25-Jun-08 21:40
Mr.Kode25-Jun-08 21:40 
AnswerRe: convert from Timespan to int ?? Pin
DaveyM6925-Jun-08 21:46
professionalDaveyM6925-Jun-08 21:46 
AnswerRe: convert from Timespan to int ?? Pin
Harvey Saayman25-Jun-08 21:47
Harvey Saayman25-Jun-08 21:47 
AnswerRe: convert from Timespan to int ?? Pin
Mbah Dhaim25-Jun-08 23:03
Mbah Dhaim25-Jun-08 23:03 
QuestionUsing stream without using memory Pin
kensai25-Jun-08 21:38
kensai25-Jun-08 21:38 
AnswerRe: Using stream without using memory Pin
Simon P Stevens25-Jun-08 22:13
Simon P Stevens25-Jun-08 22:13 
AnswerRe: Using stream without using memory Pin
Guffa26-Jun-08 0:24
Guffa26-Jun-08 0:24 
QuestionProblem with Delegates Pin
Nine_25-Jun-08 21:25
Nine_25-Jun-08 21:25 
Hi all
I'm having a problem with delegate. In my project I have 2 forms, form1 and form2. From form1 I have a button there just for opening form2. And from form2 I have a text box there to enter an Int value. After getting a value from the text box I want to send it back to form1 and appear in a text box on form1.

I do this with a delegate but I don't know if my way is the way you use to solve this problem or not.

Here is my code:

Form1

<code>
 public delegate void TestDelegate(int i);
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form2 frmOpen = new Form2();            
            frmOpen.ShowDialog();
        }
        public void GetValueA(int i)
        {
            textBox1.Text = i.ToString();         
        }
    }
</code>

Form2
<code>
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int b;
            b = Convert.ToInt32(textBox1.Text);
            
            Form1 frm1=new Form1();
            TestDelegate td = new TestDelegate(frm1.GetValueA);
            td(b);
            Close();
        }
    }
</code>

AnswerRe: Problem with Delegates Pin
DaveyM6925-Jun-08 22:00
professionalDaveyM6925-Jun-08 22:00 
AnswerRe: Problem with Delegates Pin
Kjetil Svendsen26-Jun-08 1:48
Kjetil Svendsen26-Jun-08 1:48 
Questionuser authentication using c#.net (for a web base system) Pin
sacr8325-Jun-08 21:24
sacr8325-Jun-08 21:24 
AnswerRe: user authentication using c#.net (for a web base system) Pin
leppie25-Jun-08 21:52
leppie25-Jun-08 21:52 
Questionuser authentication using c#.net (for a web base system) Pin
sacr8325-Jun-08 21:23
sacr8325-Jun-08 21:23 
AnswerRe: user authentication using c#.net (for a web base system) Pin
subai25-Jun-08 21:51
subai25-Jun-08 21:51 
QuestionExcel Issue Pin
C#Coudou25-Jun-08 21:08
C#Coudou25-Jun-08 21:08 
AnswerRe: Excel Issue Pin
Ashfield25-Jun-08 21:18
Ashfield25-Jun-08 21:18 
GeneralRe: Excel Issue Pin
C#Coudou25-Jun-08 21:34
C#Coudou25-Jun-08 21:34 
GeneralRe: Excel Issue Pin
Ashfield26-Jun-08 0:48
Ashfield26-Jun-08 0:48 
QuestionHowTo: Move DataBase Pin
Ariadne25-Jun-08 21:05
Ariadne25-Jun-08 21:05 
AnswerRe: HowTo: Move DataBase Pin
Ashfield25-Jun-08 21:19
Ashfield25-Jun-08 21:19 
AnswerRe: HowTo: Move DataBase Pin
Abhijit Jana25-Jun-08 21:31
professionalAbhijit Jana25-Jun-08 21:31 
GeneralRe: HowTo: Move DataBase Pin
Ariadne25-Jun-08 22:08
Ariadne25-Jun-08 22:08 
AnswerRe: HowTo: Move DataBase [modified] Pin
Ariadne25-Jun-08 23:41
Ariadne25-Jun-08 23:41 
Question'int' does not contain a definition for 'dataKeys' Pin
twistz25-Jun-08 20:48
twistz25-Jun-08 20:48 
AnswerRe: 'int' does not contain a definition for 'dataKeys' Pin
leppie25-Jun-08 21:21
leppie25-Jun-08 21:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.