I have AddChat on my Main Form
Than in a Class Module
i want to use addchat
So i do
frmMain.AddChat(rtbChat, Color.Yellow, "BNLS: Sending Authorization")
It says name "rtbChat" is not declared
As a test i did
frmMain.rtbChat instead of rtbChat, and than frmMain.AddChat got the same error.
Note: The Addchat works if i use it on the same form it's located.
Public Function AddChat(ByVal RichTextBox As RichTextBox, ByVal ParamArray Text() As Object) As Object
With RichTextBox
.SelectionStart = 99999999
.SelectionLength = 0
.SelectionColor = Color.White
.SelectedText = "[" & TimeOfDay & "] "
.SelectionStart = 99999999
End With
For I As Integer = Text.GetLowerBound(0) To Text.GetUpperBound(0) Step 2
With RichTextBox
.SelectionStart = 99999999
.SelectionLength = 0
.SelectionColor = Text(I)
.SelectedText = Text(I + 1) & Microsoft.VisualBasic.Left(vbCrLf, -2 * CLng((I + 1) = UBound(Text)))
.SelectionStart = 99999999
End With
Next
End Function
Bare with me.. I am still learning .NET and i don't have a Good Book, and haven't found a really nice tutorial site for vb.net ( yet )
Quote from: BaDDBLooD on June 27, 2004, 01:20 PM
Bare with me.. I am still learning .NET and i don't have a Good Book, and haven't found a really nice tutorial site for vb.net ( yet )
No offense, but any good bot writer will tell you to learn the language before attempting to make a bot. This instance is no different.
I wouldnt tell you that. I'm a fan of learning from examples. Books don't do it for me.
Same here warz =)
Anyone got any help?
Quote from: warz on June 27, 2004, 03:56 PM
I wouldnt tell you that. I'm a fan of learning from examples. Books don't do it for me.
Then learn by examples, don't learn by code. The .NET Framework SDK Documentation has more samples than the number of men your momma has slept with. (Cheesy, I know). So look at the samples. This isn't time for us to do for you.
Quote from: Myndfyre on June 27, 2004, 07:49 PM
Quote from: warz on June 27, 2004, 03:56 PM
I wouldnt tell you that. I'm a fan of learning from examples. Books don't do it for me.
Then learn by examples, don't learn by code. The .NET Framework SDK Documentation has more samples than the number of men your momma has slept with. (Cheesy, I know). So look at the samples. This isn't time for us to do for you.
Got any advice on how to do this MyndFyre? I been looking over Google.. but have found nothing on how to fix my problem.
What I would suggest is this....
The RichTextBox rtbChat belongs to an instance of frmMain. If all the work you're doing is on frmMain, then from within frmMain, all you have to do is AddChat(ByVal ParamArray data() As Object). You don't need to use ByVal rtbChat As RichTextBox. Why? Because the AddChat function already knows what RTB to add to -- the one on its form.
i have 2 ;\
By the way, you don't use frmMain.AddChat unless frmMain is static (which it is not, it's instance). You have an INSTANCE of frmMain, such as:
Sub DoSomething(ByVal fm As frmMain)
End Sub
And within that function, you can do
fm.AddChat( argument-list )