|
Hi,
I am new to VB and VB.NET. My Application is upgraded from VB6 to VB.NET. But I got some problems as "Couldn't resolve default property of object Me.". How Can I resolve these kind of warnings. Here is my code:
Private ReadOnly Property IParameter_LeseLaenge() As Integer Implements _IParameter.LeseLaenge
Get
'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'
Return I_IParameter(Me).laenge
End Get
End Property
//I_IParameter method is:
Public Function I_IParameter(ByRef obj As _IParameter) As _IParameter
I_IParameter = obj
End Function
One More:
Public WriteOnly Property SelButton() As System.Windows.Forms.Button
Set(ByVal Value As System.Windows.Forms.Button)
mSelBtn = Value
If mParent.IsAlive Then
'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'
Parent.AddCtrl(mSelBtn, Me)
End If
End Set
End Property
//AddCtrl method:
Public Sub AddCtrl(ByVal ctrl As System.Windows.Forms.Control, ByVal descriptor As _IFieldDescriptor)
'UPGRADE_ISSUE: ObjPtr function is not supported. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1040"'
mCtrls.Add(descriptor, CStr(ObjPtr(ctrl)))
End Sub
Could any one of you please let me the solution?
Thanks in Advance.
AR Reddy
|
|
|
|
|
In vb.net Me always refers to the current form... I think if u look ur code with this information u can find the issue
|
|
|
|
|
Thanks, Ill try it out.
AR Reddy
|
|
|
|
|
nishkarsh_k wrote: In vb.net Me always refers to the current form
Wrong, but I can see why you'd think this is true. Me always refers to the current instance of the class in which it is used. Since a Form is nothing but a class, Me works just like it is used in any other class code.
modified on Monday, June 30, 2008 12:37 PM
|
|
|
|
|
Hi thanks for the reply,
I am not able to get this. In VB6.0, passing a parameter as "ME", (means type is current class if I am not wrong). When we convert it to VB.NET this parameter is converting as ME only but waring message " Couldn't resolve default property of object Me." coming.
Here is the sample code.
VB6 code:
Private Property Get IParameter_SchreibLaenge() As Long
IParameter_SchreibLaenge = I_IParameter(Me).laenge
End Property
VB.NET Code:
Private ReadOnly Property IParameter_SchreibLaenge() As Integer Implements _IParameter.SchreibLaenge
Get
'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'
Return I_IParameter(Me).laenge
End Get
End Property
Note: This is nto giving any compilation error. But Its giving runtime error. When we run it, its giving some cast error.
Please help me out. I am really struggling for this to get.
Thanks in Advance,
AR Reddy
|
|
|
|
|
Under VB.NET, there is no default property for the Me object. You have to specifically tell the compiler which property of Me you are referring to.
Private ReadOnly Property IParameter_SchreibLaenge() As Integer Implements _IParameter.SchreibLaenge
Get
'UPGRADE_WARNING: Couldn't resolve default property of object Me. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'
Return I_IParameter(Me.whichProperty).laenge
End Get
End Property
<div class="ForumSig"> <small>
<a href="http://www.codeproject.com/scrapbook/ForumGuidelines.asp">A guide to posting questions on CodeProject</a>[<a href="http://www.codeproject.com/scrapbook/ForumGuidelines.asp" target="_blank" title="New Window">^</a>]</small>
<br>
<font color="Blue">Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic<br /> 2006, 2007, 2008</font>
</br>
</div>
|
|
|
|
|
|
hii
i want to calculate NORMDIST function using dotnet.
it Returns the normal distribution for the specified mean and standard deviation. This function has a very wide range of applications in statistics, including hypothesis testing.
Syntax
NORMDIST(x,mean,standard_dev,cumulative)
For this Purpose I need integral from negative infinity to x of normal density function
i m using vb.net 2005
please help me.
|
|
|
|
|
I did a google and came up with this[^], does it help ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks 4 reply but it was not helpful.
Still I m unable to implement mathematics Integration in dot net
|
|
|
|
|
OK - well, there's nothing built in. The code I linked to, claimed to do it. So, if it didn't, then you need to write your own.
'
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
anyone have any idea of using a section inside a app.config? I am looking for any example regarding this area. Thanks.
|
|
|
|
|
How do you mean, just storing settings in there ? There's tons of examples on that. If you mean something else, please clarify.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Ya.. storing settings in it and loop through the section for the desire result. Any link where by there is example to that area?
|
|
|
|
|
|
I have a string variable which contains the name of a textbox whose text I want to get/use.
How can I I create a textbox object from my variable and get the text?
Thanks!
-Steve
|
|
|
|
|
Reflection.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
If i didn't know how to phrase it for a forum, how would i know how to phrase it for a search engine? Useful keywords would have helped more than a post on how to use Google.
|
|
|
|
|
I'm sorry. I'm sorry you're so stupid. The link to google is, in fact, my sig block. My answer was actually one word. Reflection. Google reflection and you'll drown in examples on how to do what you want.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
svanwass wrote: If i didn't know how to phrase it for a forum, how would i know how to phrase it for a search engine?
Chill, dude. When in doubt, explain what you're actually trying to do - not how you think you're gonna do it. And ask follow-up questions.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
My apologies Christian. I misread your answer.
|
|
|
|
|
You could try:
with directcast(me.controls(StringName),textbox)
.Text="Blah"
end with
Although you will have to be sure that the control exists, or you will get an exception.
|
|
|
|
|
The solution has already been suggested, but whenever you need reflection to do something, you are either doing something quite advanced, or you are doing something backwards...
Why is it that you have a name of a textbox, instead of a reference to it? What is it that you are trying to accomplish really?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
My program connects to a database which populates a bunch of text boxes. I then unlock them and allow the user to edit the contents. A write button is pressed and the contents of the current text boxes are stored in an array and compared to the original database read (stored in a different array) to determine what has been changed. The position at which a change is found is store in another array. These positions correlates to another array that stores the names of the text boxes.
The step i am missing is to take that stored text box name and get the real text boxes text.
|
|
|
|
|
...so that you can then store the changed values in the database?
But don't you already have the values? Isn't the position of a changed text item also the index of the array that you first used, when the user clicks the Write button, to store what was in the text boxes? Why read from the text boxes when you can read from your array's copy of the text boxes?
|
|
|
|