Click here to Skip to main content
15,896,606 members
Home / Discussions / C#
   

C#

 
QuestionSetting the class name Pin
I_Need_Help27-Nov-07 23:57
I_Need_Help27-Nov-07 23:57 
QuestionContextMenu on a ToolStripMenuItem Pin
Johan Martensson27-Nov-07 23:46
Johan Martensson27-Nov-07 23:46 
AnswerRe: ContextMenu on a ToolStripMenuItem Pin
Nouman Bhatti28-Nov-07 0:53
Nouman Bhatti28-Nov-07 0:53 
GeneralRe: ContextMenu on a ToolStripMenuItem Pin
Johan Martensson28-Nov-07 19:34
Johan Martensson28-Nov-07 19:34 
QuestionHow to generate excel sheet in aspx page Pin
mrcsn27-Nov-07 23:27
mrcsn27-Nov-07 23:27 
AnswerRe: How to generate excel sheet in aspx page Pin
Christian Graus28-Nov-07 0:19
protectorChristian Graus28-Nov-07 0:19 
QuestionCalling a method from another form Pin
Deques27-Nov-07 22:51
Deques27-Nov-07 22:51 
AnswerRe: Calling a method from another form Pin
m@u27-Nov-07 23:05
m@u27-Nov-07 23:05 
ah those vb programmers Smile | :)

frmCore core = new frmCore(); creates a new instance of your mainform. so calling a method on this new instance will not affect the first form.

i wouldn't do it like this anyway.

my preferred solution for such things is this:
public class frmAddCategory:Form
{
   //your stuff for the form here
   public string NewPost
   {
        get
        {
            return txtNewPost.Text; // i guess you want to add the entered Value into the callers ComboBox..
        }
   }
}
public class frmCore:Form
{
    // your code here..
    private void SomeButton_Click(object sender, EventArgs e)
    {
        frmAddCategory blah = new frmAddCategory();
        if (blah.ShowDialog() == DialogResult.OK)
        {
            myComboBox.Items.Add(blah.NewPost);
        }
    }
}

greets
M@u
GeneralRe: Calling a method from another form Pin
N a v a n e e t h27-Nov-07 23:50
N a v a n e e t h27-Nov-07 23:50 
QuestionRe: Calling a method from another form Pin
Deques27-Nov-07 23:51
Deques27-Nov-07 23:51 
AnswerRe: Calling a method from another form Pin
m@u28-Nov-07 0:08
m@u28-Nov-07 0:08 
AnswerRe: Calling a method from another form Pin
N a v a n e e t h27-Nov-07 23:48
N a v a n e e t h27-Nov-07 23:48 
QuestionRe: Calling a method from another form Pin
Deques27-Nov-07 23:54
Deques27-Nov-07 23:54 
AnswerRe: Calling a method from another form Pin
Anthony Mushrow28-Nov-07 0:02
professionalAnthony Mushrow28-Nov-07 0:02 
AnswerRe: Calling a method from another form Pin
N a v a n e e t h28-Nov-07 0:08
N a v a n e e t h28-Nov-07 0:08 
QuestionRe: Calling a method from another form Pin
Deques28-Nov-07 1:38
Deques28-Nov-07 1:38 
AnswerRe: Calling a method from another form Pin
N a v a n e e t h28-Nov-07 1:47
N a v a n e e t h28-Nov-07 1:47 
GeneralRe: Calling a method from another form Pin
Deques28-Nov-07 1:58
Deques28-Nov-07 1:58 
GeneralRe: Calling a method from another form Pin
N a v a n e e t h28-Nov-07 2:04
N a v a n e e t h28-Nov-07 2:04 
AnswerRe: Calling a method from another form Pin
Nouman Bhatti28-Nov-07 0:56
Nouman Bhatti28-Nov-07 0:56 
Questionhow to make const an input variable Pin
manustone27-Nov-07 22:30
manustone27-Nov-07 22:30 
AnswerRe: how to make const an input variable Pin
m@u27-Nov-07 22:41
m@u27-Nov-07 22:41 
GeneralRe: how to make const an input variable Pin
Colin Angus Mackay27-Nov-07 23:36
Colin Angus Mackay27-Nov-07 23:36 
AnswerRe: how to make const an input variable Pin
subai27-Nov-07 22:47
subai27-Nov-07 22:47 
GeneralRe: how to make const an input variable Pin
Colin Angus Mackay27-Nov-07 23:42
Colin Angus Mackay27-Nov-07 23:42 

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.