나는 모든 웹을 통해이 같은 코드를 발견하고하지만 나를 위해 작동하지 않는 것에 사용자 컨트롤에 속성을 추가 명령 단추와 내가 붙어있는 유일한 부분은 컨트롤에 대한 캡션을 얻는 것입니다. 나는 'Text'를 보여줄 속성을 가지고 있는데, 그 안에 타이프를 입력하면 캡션을 설정하지만, 프로그램을 실행하면 캡션이 지워집니다! 내가하고있는 코드에 어떤 문제가 있습니까?</p> <pre><code>Private FText As String Public Property Get Text() As String Text = FText lblText.Caption = Text End Property Public Property Let Text(ByVal Value As String) FText = Value End Property </code></pre> <p>좀 더 내가 뭐하는 거지, 난을 만드는 오전을 설명하자, VB6
-1
A
답변
1
해결했습니다.
Const m_def_Caption = "Cmd"
'Dim m_Picture As Picture
Dim m_Caption As String
Private Sub UserControl_InitProperties()
m_Caption = m_def_Caption
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
m_Caption = PropBag.ReadProperty("Caption", m_def_Caption)
lblText.Caption = m_Caption
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Caption", m_Caption, m_def_Caption)
End Sub
Public Property Get Caption() As String
Caption = m_Caption
End Property
Public Property Let Caption(ByVal New_Caption As String)
m_Caption = New_Caption
PropertyChanged "Caption"
End Property
귀하의 도움에 감사 드리며,이 문제를 직접 해결할 수있어서 기쁩니다.
관련 문제
- 1. Public Overrides 속성 Text As String vb.net
- 2. CSS와 일치하는 정규 표현식 "<property> : <value>"
- 3. </p> <pre><code>Dim foo As String = "Привет мир" </code></pre> <p>내가 만든 ... 나는 내가 선언 한 짧은 줄을 초기화 할 수 있습니다 <code>VB.NET</code>의 유형에 내장 중 하나를 사용하는 경우 한 줄
- 4. VBA 클래스 모듈의 속성을 허용하자 - 여러 개의 인수를 가질 수 있습니까? 당신은 당신이 할 수있는이 클래스의 객체를 생성 한 후 다음을</p> <pre><code>Dim pName as String Public Property Let Name(Value As String) pName = Value End Property </code></pre> <p>을 그리고 : 지금까지 클래스 모듈에하자 속성을 사용
- 5. 한 줄에 VB.NET Public Property
- 6. Javascript RegExp as property
- 7. 독서 <property> 태그
- 8. getElementsByTagName 여기서 property == value?
- 9. Valid <property> Ant의 이름
- 10. 다중 할당 (field = Property = value)
- 11. PHP "<<< TEXT 일부 콘텐츠 TEXT"
- 12. 문자열을 숨기려면 <property name = "password"value = "***"/> GitHub에서 public 일 때?
- 13. 변환 목록 <Property>는
- 14. 이 객체에서</p> <pre><code>Property 'conf' is missing in type '{ text: string; label: string; }'. </code></pre> <p>얻기 각도 2
- 15. text/plain에서 text/xml로 응답을 변경하는 방법
- 16. Letter-string, Get value long VBA
- 17. Return Dictionary <string, string> 또는 IEnumerable <KeyValuePair <string, string >>
- 18. List <KeyValuePair <string, string >>
- 19. Angular2 사용 [(ngModel는)] [ngModelOptions] = "{독립형 : TRUE}"로 :</p> <pre><code>export class Mailtype { constructor( public name?: string, public locale?: string, public email?: string, public properties? : Property[] ) { } } </code></pre> <p>을
- 20. System.Collections.Generic.Dictionary <string, string>
- 21. 목록 만들기 <string> 사전에서 <string, string>
- 22. testng reporter.log는 "<"as "["
- 23. HashMap <String, LinkedList <String>>을 텍스트 파일로 채우는 방법?</p> <pre><code>Key,Value,Value,Value Key,Value,Value,Value,Value,Value,Value Key,Value,Value,Value,Value,Value </code></pre> <p>내가 해시 맵에 자신의 값으로 모든 키를 넣을 :
- 24. MVVM Properties in ViewModel? 뷰 모델에서</p> <pre><code><TextBox Text="{Binding MyValue, Mode=TwoWay}"/> <TextBlock Text="{Binding DisplayValue}"/> </code></pre> <p>재산권 :
- 25. 외부 스크립트에서 Public Property 변수 가져 오기
- 26. ReadOnlyCollection <string> 및 IList의 <string>
- 27. spring 3.1.2 RELEASE, <context : property-placeholder /> 사용법
- 28. Velocity 테이블에서 Map <String, List <String>>
- 29. 한 라이너를 awk가 : 나는</p> <pre><code><string name="my/ attribute" optional="true"> <description>some text</description> <value>some text again</value> </string> </code></pre> <p>같은 일부 속성을 포함하는 XML 파일을 가지고
- 30. For Each Loop, Map <String, Map <String, List <String> >>