Zealot's Blog

Coding life...
数据加载中……

2004年9月23日

安装Visual Studio.NET 2005 beta 1不能选择安装路径

在家里安装Visual Studio.NET 2005 beta1 之后,发现可以和Visual Studio.NET 2003 side by side,想在 在公司的机器上安装,发现不能选择安装路径,默认在C: ,但C:\ 没有空间了。提示说我自前安装过.NET Frmaework 2.0 beta SDK ,我是安装过,但几天前已经卸载了啊。

有人遇到这样的问题吗?

posted @ 2004-09-23 12:57 Zealot 阅读(1892) 评论(3) 编辑
一个带提示的TextBox

体验了一下vs.net 2005 beta 1的IDE,试着写了一个儿科级的Control.
WinForm Control, 类似于一些Web表单上Textbox中的提示文本,一旦获取焦点,提示信息自动清除,当Textbox内容为空,失去焦点时提示又会出些。

如下图:



Using directive

namespace Zealot.PromptTextBox
{
    
public class
 PromptTextBox: TextBox
    
{
        
private string promptString = string
.Empty;
        
private bool IsEmpty = true
;
        
public
 PromptTextBox()
        
{
            InitializeComponent();
        }

        
public PromptTextBox(string prompt)
        
{
            InitializeComponent();
            
this.PromptString =
 prompt;
        }

        
/// <summary>
        
/// Prompt Text
        
/// </summary>

        public string PromptString
        
{
            
get return this.promptString; }

            
set this.promptString = value; }
        }

        
protected override void OnEnter(EventArgs e)
        
{
            
if (this.IsEmpty){this.Clear();}

        }

        
protected override void OnLeave(EventArgs e)
        
{
            
if (this.Text == string
.Empty)
            
{
                
this.Text = this
.PromptString;
                
this.IsEmpty = true
;
            }

            
else {this.IsEmpty = false;}
        }

        
public override string Text
        
{
            
get

            
{
                
if (this.IsEmpty) {return string.Empty;}

                
else {return base.Text;}
            }

            
set
            
{
                
if (value == string
.Empty)
                
{
                    
base.Text = this
.PromptString;
                    
this.IsEmpty = true
;
                }

                
else
                
{
                    
this.IsEmpty = (value == this
.PromptString);
                    
base.Text =
 value;
                }

            }

        }

        
protected override void OnCreateControl()
        
{
            
if (this.Text == string
.Empty)
            
{
                
this.Text = this
.PromptString;
                
this.IsEmpty = true
;
            }

            
else {this.IsEmpty = false;}
        }

    }

}


btw: // vs.net 2005 beta1问题多多,尤其是窗体设计时,狂吃内存(设计调试时150M以上),看来我的机器可以淘汰了。
P3 733  ; 384M ROM,

posted @ 2004-09-23 00:42 Zealot 阅读(1748) 评论(2) 编辑