2关于属性属性的问题 [英] 2 Questions about Property Attributes

查看:103
本文介绍了2关于属性属性的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi, I have two questions:
1. How can I have A Text Property Like TextBox ...
2. How can I Make Browse For File or Directory Property ...





< img src =http://city-upload.com/i/00001/5kvttzo3z24p_t.jpgborder = 0>

推荐答案

我找到它:





[VB]

I Find it:


[VB]
Private TargetValue As String
<Editor(GetType(System.Windows.Forms.Design.FolderNameEditor), GetType(System.Drawing.Design.UITypeEditor))> _
    Public Property Target() As String
    Get
        Return TargetValue
    End Get
    Set(ByVal value As String)

        TargetValue = value
    End Set
End Property

Private TagValue As String
<Editor(GetType(System.ComponentModel.Design.MultilineStringEditor), GetType(System.Drawing.Design.UITypeEditor))> _
Public Property Tag() As String
    Get
        Return TagValue
    End Get
    Set(ByVal value As String)
        TagValue = value
    End Set
End Property



[/ VB]


[/VB]


  1. 什么你的意思是喜欢吗? TextBox 与否?无论如何,只有几个例子:

  1. What do you mean "like"? TextBox or not? Anyway, just a few examples:
class MyType {
    internal TextBox FirstTextBox { get; set; }
    public TextBox SecondTextBox { get; private set; }
    public TextBox ThirdTextBox {
       get { return thirdTextBox; }
    }
    // and so on...
    TextBox thirdTextBox = new TextBox();
    // ...
}

  • 您需要查看任何类似的方法。请参阅:

    http://msdn.microsoft .com / zh-cn / library / system.io.directory.getdirectories.aspx [ ^ ],

    http://msdn.microsoft.com/en-us/library/system.io.directory.getfiles.aspx [ ^ ],

    http://msdn.microsoft.com/en-us/library/system .io.directoryinfo.getdirectories.aspx [ ^ ],

    http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.getfiles.aspx [ ^ ] 。
  • You need to look any many pretty similar methods. Please see:
    http://msdn.microsoft.com/en-us/library/system.io.directory.getdirectories.aspx[^],
    http://msdn.microsoft.com/en-us/library/system.io.directory.getfiles.aspx[^],
    http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.getdirectories.aspx[^],
    http://msdn.microsoft.com/en-us/library/system.io.directoryinfo.getfiles.aspx[^].




  • 祝你好运,

    -SA


    我的意思是:我想为textcon或Label Control设置Property Like Text属性,以便在设计模式下使用



    谢谢
    I mean: I want to make Property Like Text Property of TextBox or Label Control for usercontrol to use in design mode

    thanks


    这篇关于2关于属性属性的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆