By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,263 Members | 1,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,263 IT Pros & Developers. It's quick & easy.

what in vb.net

P: n/a
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,
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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

"Supra" wrote:
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,

Nov 21 '05 #2

P: n/a
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/de...efragments.asp

:-)

Cor
Nov 21 '05 #3

P: n/a
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[MVP] wrote:
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

"Supra" wrote:
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,

Nov 21 '05 #4

P: n/a
"Supra" <su***@domain.invalid> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.