Click here to Skip to main content
15,895,746 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: accept a string and convert the case of the characters Pin
Luc Pattyn27-May-09 12:21
sitebuilderLuc Pattyn27-May-09 12:21 
AnswerRe: accept a string and convert the case of the characters Pin
EliottA27-May-09 11:25
EliottA27-May-09 11:25 
AnswerRe: accept a string and convert the case of the characters Pin
Luc Pattyn27-May-09 11:39
sitebuilderLuc Pattyn27-May-09 11:39 
QuestionDate Design Suggestion... Pin
smjunior0927-May-09 7:36
smjunior0927-May-09 7:36 
AnswerRe: Date Design Suggestion... Pin
Dave Kreskowiak27-May-09 7:46
mveDave Kreskowiak27-May-09 7:46 
GeneralRe: Date Design Suggestion... Pin
smjunior0927-May-09 7:53
smjunior0927-May-09 7:53 
GeneralRe: Date Design Suggestion... Pin
Dave Kreskowiak27-May-09 10:22
mveDave Kreskowiak27-May-09 10:22 
QuestionSubclass a Control by UserControl Pin
Samir Ibrahim27-May-09 6:36
Samir Ibrahim27-May-09 6:36 
Hi all

in VFP, When I begin to work with a project, I create control that is a subclass of it is baseclass, then I code what I want to this subclass, then I drag it and put it on the form. and I use this subclass in all my forms later on.

Now to make that in vb.net I found the UserControl is the closet control to do what I want.

Q1: Is UserControl is the right direction to achieve what I want?

I have did some tests on UserControl and I have these questions

1- Why it gives warning in 'Me.Version = "1.0"
2- Why it gives warning and my vb crashes and could not be restarted unless I close all vb IDE's in Version = value
3- Should I assign a new variable (m_version) for each property I want to add? Cannot I work directly with property?

4- When I drag the control to my form, I notice that the control (Textbox) (width and height) are not expanded to take the the Length and Height of the Usercontrol. Should I handle that manually?

5- I have included many code in the Get, so I would like to know what is the best I should use.

Public Class UserControl1 ' I add Textbox
    Dim m_Version
    Property Version()
        Get
            'Version = "1.0"    ' Worked Fine
            'Me.Version = "1.0" ' Warning	3	Property 'Version' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used.	
            'Return "1.0"       ' Worked Fine
            Return m_Version    ' Worked Fine
        End Get
        Set(ByVal value)
            m_Version = value ' Works Fine
            'Version = value   ' Warning	3	Expression recursively calls the containing property 'Version'.	
        End Set
    End Property
End Class


TIA

Like car accidents, most hardware problems are due to driver error.

Samir R. Ibrahim

AnswerRe: Subclass a Control by UserControl Pin
EliottA27-May-09 7:03
EliottA27-May-09 7:03 
GeneralRe: Subclass a Control by UserControl Pin
Samir Ibrahim27-May-09 21:37
Samir Ibrahim27-May-09 21:37 
AnswerRe: Subclass a Control by UserControl Pin
Dave Kreskowiak27-May-09 7:10
mveDave Kreskowiak27-May-09 7:10 
GeneralRe: Subclass a Control by UserControl Pin
Samir Ibrahim27-May-09 21:36
Samir Ibrahim27-May-09 21:36 
GeneralRe: Subclass a Control by UserControl Pin
Dave Kreskowiak28-May-09 2:19
mveDave Kreskowiak28-May-09 2:19 
GeneralRe: Subclass a Control by UserControl Pin
Samir Ibrahim28-May-09 3:46
Samir Ibrahim28-May-09 3:46 
GeneralRe: Subclass a Control by UserControl Pin
Nagy Vilmos28-May-09 3:56
professionalNagy Vilmos28-May-09 3:56 
GeneralRe: Subclass a Control by UserControl Pin
Samir Ibrahim28-May-09 4:19
Samir Ibrahim28-May-09 4:19 
GeneralRe: Subclass a Control by UserControl Pin
Nagy Vilmos28-May-09 4:35
professionalNagy Vilmos28-May-09 4:35 
GeneralRe: Subclass a Control by UserControl Pin
Dave Kreskowiak28-May-09 5:38
mveDave Kreskowiak28-May-09 5:38 
GeneralRe: Subclass a Control by UserControl Pin
Dave Kreskowiak28-May-09 4:21
mveDave Kreskowiak28-May-09 4:21 
GeneralRe: Subclass a Control by UserControl Pin
Trollslayer28-May-09 3:03
mentorTrollslayer28-May-09 3:03 
GeneralRe: Subclass a Control by UserControl Pin
Nagy Vilmos28-May-09 3:20
professionalNagy Vilmos28-May-09 3:20 
GeneralRe: Subclass a Control by UserControl Pin
Samir Ibrahim28-May-09 3:58
Samir Ibrahim28-May-09 3:58 
GeneralRe: Subclass a Control by UserControl Pin
EliottA28-May-09 5:32
EliottA28-May-09 5:32 
GeneralRe: Subclass a Control by UserControl Pin
Nagy Vilmos28-May-09 5:34
professionalNagy Vilmos28-May-09 5:34 
GeneralRe: Subclass a Control by UserControl Pin
Jerry Hammond28-May-09 3:41
Jerry Hammond28-May-09 3:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.