what in vb.net

S

Supra

in vb 6
in class project:
Private varNewChan As Collection 'new channel window

withevents procedure events:
Private Sub RFC_Ob_onNickJoin(ByVal szNick As String, ByVal szHost As
String, ByVal szChan As String) Handles RFC_Ob.onNickJoin

UPGRADE_WARNING: Couldn't resolve default property of object
varNewChan.Item().rtfChan. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'
DisplayMessage(varNewChan.Item(szChan).rtfChan, "*** " &
szNick & " [" & szHost & "] " & "has just joined " & szChan,
GetUserColours.colourJoin, 7)
end sub

how do i get varNewChan.Item(i) make them to work? it doesn't sent
message to rtfChan. rtfChan is richtextbox that i wizarded from vb6 to
vb.net
regards,
 
G

Guest

The error is that VB.NET does not support default properties like VB 6. In
VB6, when you say Text1, you mean Text1.Text as "Text" is the default
property. In VB.NET you need to say Text1.Text, as writing Text1, will result
in an error. So you need to just fill out the property you need to access,
instead of depending on the default property.

Rgds,
Anand
http://www.dotnetindia.com
 
C

Cor Ligthert

Anand,
The error is that VB.NET does not support default properties like VB 6. In
VB6, when you say Text1, you mean Text1.Text as "Text" is the default
property. In VB.NET you need to say Text1.Text, as writing Text1, will
result
in an error. So you need to just fill out the property you need to access,
instead of depending on the default property.

VBNet support default properties. However "Item" is mostly the default
property.

Dataset.Tables(0).Rows(0)(0) means for the last one the default property
Item.

http://msdn.microsoft.com/library/d...n-us/vbcn7/html/vbconpastingcodefragments.asp

:)

Cor
 
S

Supra

Anand

Sub DisplayMessage(ByVal rtb As RichTextBox, ByVal sText As String)
rtb.SelectionStart = rtb.Text.Length
rtb.SelectionLength = 0
rtb.SelectedText = sText
rtb.ScrollToCaret()
End Sub


varNewChan.Item().rtfChan is same as richtextbox1.selectedtext. the varNewchan is collection of form(s)
i have been reading posted by Alex as above. but nobody can't help
:-(




Anand said:
The error is that VB.NET does not support default properties like VB 6. In
VB6, when you say Text1, you mean Text1.Text as "Text" is the default
property. In VB.NET you need to say Text1.Text, as writing Text1, will result
in an error. So you need to just fill out the property you need to access,
instead of depending on the default property.

Rgds,
Anand
http://www.dotnetindia.com

:


in vb 6
in class project:
Private varNewChan As Collection 'new channel window

withevents procedure events:
Private Sub RFC_Ob_onNickJoin(ByVal szNick As String, ByVal szHost As
String, ByVal szChan As String) Handles RFC_Ob.onNickJoin

UPGRADE_WARNING: Couldn't resolve default property of object
varNewChan.Item().rtfChan. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'
DisplayMessage(varNewChan.Item(szChan).rtfChan, "*** " &
szNick & " [" & szHost & "] " & "has just joined " & szChan,
GetUserColours.colourJoin, 7)
end sub

how do i get varNewChan.Item(i) make them to work? it doesn't sent
message to rtfChan. rtfChan is richtextbox that i wizarded from vb6 to
vb.net
regards,
 
H

Herfried K. Wagner [MVP]

Supra said:
Sub DisplayMessage(ByVal rtb As RichTextBox, ByVal sText As String)
rtb.SelectionStart = rtb.Text.Length
rtb.SelectionLength = 0
rtb.SelectedText = sText
rtb.ScrollToCaret()
End Sub

Note that this code will only have the desired effect of scrolling the last
last line into view if the richtextbox has the focus. You can make sure
that the richtextbox control has the focus by calling its 'Focus' method
prior to calling its 'ScrollToCaret' method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top