C# උදවුවක්

Aventador RLR

Junior member
  • Mar 1, 2016
    143
    11
    18
    kandy
    ළමයිනේ...මම software එකක් හදනව..ඒකේ එක තැනකදි වෙනත් form එකක තියන textbox එකක value එක අනිත් form එකෙන් එන massage box එක ok කරද්දි clear වෙන්න ඔනේ:love:..එත් තාම code එක ලියා ගන්න බැ:confused:...දන්න කවුරු හරි උදවුවක් කරන්න....:(:(

    Capture1.JPG

    කරපු හෙමෝටම ගොඩක් thanks..මේ තමයි mark button එකට එන code එක..මෙතන තියන yes එක ok කරාම තමයි අර කිවුව අනිත් form එකේ textbox එකේ value එක අයින් වෙන්න ඔනේ...දන්න කවුරුත් නෑද්ද? :confused:

    please help:sorry::baffled:
     

    Aventador RLR

    Junior member
  • Mar 1, 2016
    143
    11
    18
    kandy
    ළමයිනේ...මම software එකක් හදනව..ඒකේ එක තැනකදි වෙනත් form එකක තියන textbox එකක value එක අනිත් form එකෙන් එන massage box එක ok කරද්දි clear වෙන්න ඔනේ:love:..එත් තාම code එක ලියා ගන්න බැ:confused:...දන්න කවුරු හරි උදවුවක් කරන්න....කරපු හෙමෝටම ගොඩක් thanks..මේ තමයි mark button එකට එන code එක..මෙතන තියන yes එක ok කරාම තමයි අර කිවුව අනිත් form එකේ textbox එකේ value එක අයින් වෙන්න ඔනේ...දන්න කවුරුත් නෑද්ද? :confused:

    Capture1.JPG

    please help:sorry::baffled:
     

    Scattered123

    Well-known member
  • Nov 18, 2012
    949
    323
    63
    Does it matter?
    ubata makanna oena boks eka thiyena foem eka mAseij boks eka ena foem eka harahaa oepan karapan.

    උබට ලේසි වෙන්න ඔක්කොම දැම්මා ඔන්න


    Code:
    public partial class Form1 : Form
        {
            private Form2 form2;
            public Form1() 
            {
                InitializeComponent();
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                form2 = new Form2();
                form2.Show();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                form2.ClearBox(); // clears the txtbox in form2
            }
        }

    Form2

    Code:
    public partial class Form2 : Form
        {
            public Form2()
            {
                InitializeComponent();
            }
    
            public void ClearBox()
            {
                textBox1.Text = String.Empty;
            }
    
            private void Form2_Load(object sender, EventArgs e)
            {
    
            }
        }
     
    • Like
    Reactions: Aventador RLR

    Aventador RLR

    Junior member
  • Mar 1, 2016
    143
    11
    18
    kandy
    ubata makanna oena boks eka thiyena foem eka mAseij boks eka ena foem eka harahaa oepan karapan.

    උබට ලේසි වෙන්න ඔක්කොම දැම්මා ඔන්න


    Code:
    public partial class Form1 : Form
        {
            private Form2 form2;
            public Form1() 
            {
                InitializeComponent();
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                form2 = new Form2();
                form2.Show();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                form2.ClearBox(); // clears the txtbox in form2
            }
        }

    Form2

    Code:
    public partial class Form2 : Form
        {
            public Form2()
            {
                InitializeComponent();
            }
    
            public void ClearBox()
            {
                textBox1.Text = String.Empty;
            }
    
            private void Form2_Load(object sender, EventArgs e)
            {
    
            }
        }


    :love::love::love::love::love::love::):yes:

    thnaks bro....:love::love::love:
     

    0cean

    Member
    May 25, 2017
    841
    58
    0
    N/A
    Try this

    ළමයිනේ...මම software එකක් හදනව..ඒකේ එක තැනකදි වෙනත් form එකක තියන textbox එකක value එක අනිත් form එකෙන් එන massage box එක ok කරද්දි clear වෙන්න ඔනේ:love:..එත් තාම code එක ලියා ගන්න බැ:confused:...දන්න කවුරු හරි උදවුවක් කරන්න....කරපු හෙමෝටම ගොඩක් thanks..මේ තමයි mark button එකට එන code එක..මෙතන තියන yes එක ok කරාම තමයි අර කිවුව අනිත් form එකේ textbox එකේ value එක අයින් වෙන්න ඔනේ...දන්න කවුරුත් නෑද්ද? :confused:

    View attachment 70934

    please help:sorry::baffled:

    Lesima widiya methana this.close() ekata udin textbox eka clr karanna method ekak liyala eka call karanna.

    Code:
    [COLOR="silver"]Messagebox.Show("Saved");[/COLOR]
    txtclear();
    [COLOR="Silver"]this.close();[/COLOR]


    Anith Form eka.

    Code:
    private void txtclear()
    {
      textbox.text = String.Empty;
    }
     

    slickdeath

    Well-known member
  • Sep 3, 2014
    3,395
    1,662
    113
    Value eka delete karanna oni form eke class eka singeleton krnna..eke public method ekak liyanna text box eka clear wenna. Ethkota anith form eken ara form eke instance eke method eka call karanna puluwn.. Singeleton kiynne mokakda danne neththm singeleton design pattern eka gena issala tikak igena gena inna
     
    • Like
    Reactions: Aventador RLR

    Aventador RLR

    Junior member
  • Mar 1, 2016
    143
    11
    18
    kandy
    Value eka delete karanna oni form eke class eka singeleton krnna..eke public method ekak liyanna text box eka clear wenna. Ethkota anith form eken ara form eke instance eke method eka call karanna puluwn.. Singeleton kiynne mokakda danne neththm singeleton design pattern eka gena issala tikak igena gena inna

    eththa machan...thanks for help bro...:love::love::yes:
     

    Aventador RLR

    Junior member
  • Mar 1, 2016
    143
    11
    18
    kandy
    Lesima widiya methana this.close() ekata udin textbox eka clr karanna method ekak liyala eka call karanna.

    Code:
    [COLOR="silver"]Messagebox.Show("Saved");[/COLOR]
    txtclear();
    [COLOR="Silver"]this.close();[/COLOR]


    Anith Form eka.

    Code:
    private void txtclear()
    {
      textbox.text = String.Empty;
    }


    try kara machan...but thaama hodak ne:sorry:...i will try mchan:yes:
    thanks for help bro:love::love:
     

    Aventador RLR

    Junior member
  • Mar 1, 2016
    143
    11
    18
    kandy
    කොල්ලනේ....උදවු කරපු හැමෝටම ගොඩාක් ස්තූති...ඔයාලා දුන්න code blocks හරි..එත් මේක නිසා error එකක් එනවා...

    මේක දාලා තියෙන්නේ log වෙන කෙනා admin ද user ද කියලා පෙන්නන්න...:(
    form.JPG

    ඒ status එක නිසා මෙතන error එකක් පෙන්නනවා:sorry::sorry:
    form2.JPG