• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
wysky
博客园    首页    新随笔    联系   管理    订阅  订阅
窗体外的类操作窗体控件的问题
窗体外的类操作窗体控件的处理办法==!
窗体TestForm:
public string SetTextBox
        
{
            
set
            
{
                
this.textBox1.Text = value;
            }

        }


        
public partial class TestForm : Form
        
{
            
public string SetTextBox
            
{
                
set
                
{
                    
this.textBox1.Text = value;
                }

            }


            
public TestForm()
            
{
                InitializeComponent();
            }

        }
窗体外的一个类newtest:
using System;
using System.Collections.Generic;
using System.Text;

namespace natsuwind.PetBot
{
    
class newtest
    
{       

        
public static void Start()
        
{
            TestForm myForm 
= new TestForm();
            myForm.SetTextBox 
= "1231315";          
        }

    }

}
在另外一个类里面调用newtest{}里面的Start()方法,TestForm里面的TextBox1的显示还是没有改变的呢.
PS:不报错 但是也没有显示成功
奇怪好久了
麻烦大家了~~~帮帮忙~~~
posted on 2007-04-17 11:24  文's sky  阅读(526)  评论(4)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3