borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Crystal Reports Help)Next Topic (InternetExplorer.Application help request) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : Need Help
Poster Message
Tripic
Level: Protégé

Registered: 05-08-2005
Posts: 8

icon Need Help

Hello All Im A bit of a noob to Vb period but in any case i am working on a Chataplication and am running into some problems with Client to server Communications for instance when i change a font in the Send box It doesnt send the font with the text i need to figgure out a user system etc. Im looking for any help I can get in this process. I cant say that i can pay you do to lack of funds and this is more of a learning experience for me then anything else. I can however offer some form of payment in that anyone that will help me i will host a webite for them for 1 year on my server at no cost...
I can be contacted at Blackrose_1100@hotmail.com on MSN Mess. or at ia-net.net on irc in rooms xphaze1 - Xphaze4 thanks for any help in advance

05-08-2005 at 08:00 PM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon Re: Need Help

Wow Tripic! u're so generous ... Ummm i'd like to help u (or rather help me heheh) ... so here i go:
Assuming u can send the text to the client OK, then u can send the name of the font to the client as well!
If u're using a textbox on the server side, u can send the name by using the FontName property of the textbox.
Then on the client side, just, where u've written the code for receiving the text, add a line, which would receive the fontname, and set the fontname in the client app's textbox...
Hope I got u correct....



____________________________
lOsT...

06-08-2005 at 12:04 AM
View Profile Send Email to User Show All Posts | Quote Reply
Tripic
Level: Protégé

Registered: 05-08-2005
Posts: 8
icon Re: Need Help

I have already tried this and it doesnt seem to work for me all of the data including the font data just gets printed to the Main Text Screen  or the chat history widow i need to figure out how to seperate them right now rather the using a send font command i switched to using rtf and using a send blank.rtf command that send all of the data but i cant figure out how to parce it back so that that data then can be used for that lines font color etc  here is an example of what i get back in the chat screen...

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}

\viewkind4\uc1\pard\f0\fs17 Test Message\par

}

10-08-2005 at 09:50 AM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon Re: Need Help

Hi Tripic,
I'm sorry that i don't have vb .NET installed currently...
Anywayz, i d/loaded ur code.. I tried to understand it....I couldn't find any code that deals wid da font thingy, other than the SendF function!?

I'll suggest the following changes in ur code (changes r in CAPS):


    'Connection Set
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        A = New TcpClient("69.44.152.91", 8999)
B = NEW TCPCLIENT("69.44.152.91", 8998)
        DisplayText("Welcome to Gamerz Leagues" & vbCrLf)
        A.GetStream.BeginRead(D, 0, 1024, AddressOf DoRead, Nothing)
    End Sub


    'Send Button
    Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
        Send(txtSend.text)
SENDF(TXTSEND.FONTNAME)
        txtSend.Rtf = ""
    End Sub


    'DoRead
    Private Sub DoRead(ByVal ar As IAsyncResult)
        Dim intCount As Integer

        Try
            intCount = A.GetStream.EndRead(ar)
            If intCount < 1 Then
                MarkAsDisconnected()
                Exit Sub
            End If

            BuildString(D, 0, intCount)

            A.GetStream.BeginRead(D, 0, 1024, AddressOf DoRead, Nothing)

'WRITE CODE HERE TO READ FROM "B" STREAM
IF FROMB <> "" THEN
txtDisplay.FontName = FROMB
END IF
        
Catch e As Exception
            MarkAsDisconnected()
        End Try
    End Sub

Lemme know if this works fine...

____________________________
lOsT...

12-08-2005 at 03:00 AM
View Profile Send Email to User Show All Posts | Quote Reply
Tripic
Level: Protégé

Registered: 05-08-2005
Posts: 8
icon Re: Need Help

Lol i stoped using that method because some one told me it was better to use rtf

heres how its sent now

    Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
        Send(txtSend.Rtf)

        txtSend.Rtf = ""
    End Sub

12-08-2005 at 03:43 AM
View Profile Send Email to User Show All Posts | Quote Reply
Tripic
Level: Protégé

Registered: 05-08-2005
Posts: 8
icon Re: Need Help

ok i tired your ideah but i keep getting fromb not declared and have no ideah where to declare it??

12-08-2005 at 04:11 AM
View Profile Send Email to User Show All Posts | Quote Reply
Tripic
Level: Protégé

Registered: 05-08-2005
Posts: 8
icon Re: Need Help

Imports System.Text
Imports System.Net.Sockets
Public Class ChatClient
    Inherits System.Windows.Forms.Form
    Public Delegate Sub DisplayInvoker(ByVal t As String)
#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents btnSend As System.Windows.Forms.Button
    Friend WithEvents txtDisplay As System.Windows.Forms.RichTextBox
    Friend WithEvents FontDialog1 As System.Windows.Forms.FontDialog
    Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
    Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem7 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem8 As System.Windows.Forms.MenuItem
    Friend WithEvents ColorDialog1 As System.Windows.Forms.ColorDialog
    Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
    Friend WithEvents ColorDialog2 As System.Windows.Forms.ColorDialog
    Friend WithEvents ColorDialog3 As System.Windows.Forms.ColorDialog
    Friend WithEvents MenuItem9 As System.Windows.Forms.MenuItem
    Friend WithEvents ColorDialog4 As System.Windows.Forms.ColorDialog
    Friend WithEvents ColorDialog5 As System.Windows.Forms.ColorDialog
    Friend WithEvents MenuItem10 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem11 As System.Windows.Forms.MenuItem
    Friend WithEvents txtSend As System.Windows.Forms.RichTextBox
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents txtroomname As System.Windows.Forms.TextBox
    Friend WithEvents txtroompass As System.Windows.Forms.TextBox
    Friend WithEvents rmmessage As System.Windows.Forms.RichTextBox
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents txtmessage As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.btnSend = New System.Windows.Forms.Button
        Me.txtDisplay = New System.Windows.Forms.RichTextBox
        Me.FontDialog1 = New System.Windows.Forms.FontDialog
        Me.MainMenu1 = New System.Windows.Forms.MainMenu
        Me.MenuItem1 = New System.Windows.Forms.MenuItem
        Me.MenuItem2 = New System.Windows.Forms.MenuItem
        Me.MenuItem3 = New System.Windows.Forms.MenuItem
        Me.MenuItem4 = New System.Windows.Forms.MenuItem
        Me.MenuItem5 = New System.Windows.Forms.MenuItem
        Me.MenuItem6 = New System.Windows.Forms.MenuItem
        Me.MenuItem7 = New System.Windows.Forms.MenuItem
        Me.MenuItem8 = New System.Windows.Forms.MenuItem
        Me.MenuItem9 = New System.Windows.Forms.MenuItem
        Me.MenuItem10 = New System.Windows.Forms.MenuItem
        Me.MenuItem11 = New System.Windows.Forms.MenuItem
        Me.ColorDialog1 = New System.Windows.Forms.ColorDialog
        Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog
        Me.ColorDialog2 = New System.Windows.Forms.ColorDialog
        Me.ColorDialog3 = New System.Windows.Forms.ColorDialog
        Me.ColorDialog4 = New System.Windows.Forms.ColorDialog
        Me.ColorDialog5 = New System.Windows.Forms.ColorDialog
        Me.txtSend = New System.Windows.Forms.RichTextBox
        Me.GroupBox1 = New System.Windows.Forms.GroupBox
        Me.Button1 = New System.Windows.Forms.Button
        Me.rmmessage = New System.Windows.Forms.RichTextBox
        Me.txtroomname = New System.Windows.Forms.TextBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label4 = New System.Windows.Forms.Label
        Me.txtroompass = New System.Windows.Forms.TextBox
        Me.txtmessage = New System.Windows.Forms.TextBox
        Me.GroupBox1.SuspendLayout()
        Me.SuspendLayout()
        '
        'btnSend
        '
        Me.btnSend.BackColor = System.Drawing.Color.Gainsboro
        Me.btnSend.Location = New System.Drawing.Point(336, 376)
        Me.btnSend.Name = "btnSend"
        Me.btnSend.TabIndex = 0
        Me.btnSend.Text = "&Send "
        '
        'txtDisplay
        '
        Me.txtDisplay.Location = New System.Drawing.Point(16, 80)
        Me.txtDisplay.Name = "txtDisplay"
        Me.txtDisplay.ReadOnly = True
        Me.txtDisplay.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedHorizontal
        Me.txtDisplay.Size = New System.Drawing.Size(312, 272)
        Me.txtDisplay.TabIndex = 1
        Me.txtDisplay.Text = ""
        '
        'FontDialog1
        '
        Me.FontDialog1.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!)
        Me.FontDialog1.FontMustExist = True
        Me.FontDialog1.MaxSize = 18
        Me.FontDialog1.MinSize = 18
        Me.FontDialog1.ShowApply = True
        Me.FontDialog1.ShowColor = True
        '
        'MainMenu1
        '
        Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem3, Me.MenuItem10})
        '
        'MenuItem1
        '
        Me.MenuItem1.Index = 0
        Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem2})
        Me.MenuItem1.Text = "File"
        '
        'MenuItem2
        '
        Me.MenuItem2.Index = 0
        Me.MenuItem2.Text = "Exit"
        '
        'MenuItem3
        '
        Me.MenuItem3.Index = 1
        Me.MenuItem3.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem4, Me.MenuItem5})
        Me.MenuItem3.Text = "Format"
        '
        'MenuItem4
        '
        Me.MenuItem4.Index = 0
        Me.MenuItem4.Text = "Font"
        '
        'MenuItem5
        '
        Me.MenuItem5.Index = 1
        Me.MenuItem5.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem6, Me.MenuItem7, Me.MenuItem8, Me.MenuItem9})
        Me.MenuItem5.Text = "BG Color"
        '
        'MenuItem6
        '
        Me.MenuItem6.Index = 0
        Me.MenuItem6.Text = "Main"
        '
        'MenuItem7
        '
        Me.MenuItem7.Index = 1
        Me.MenuItem7.Text = "Recived"
        '
        'MenuItem8
        '
        Me.MenuItem8.Index = 2
        Me.MenuItem8.Text = "Send"
        '
        'MenuItem9
        '
        Me.MenuItem9.Index = 3
        Me.MenuItem9.Text = "Send Button"
        '
        'MenuItem10
        '
        Me.MenuItem10.Index = 2
        Me.MenuItem10.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem11})
        Me.MenuItem10.Text = "Room "
        '
        'MenuItem11
        '
        Me.MenuItem11.Index = 0
        Me.MenuItem11.Text = "Edit"
        '
        'ColorDialog1
        '
        Me.ColorDialog1.AnyColor = True
        '
        'OpenFileDialog1
        '
        Me.OpenFileDialog1.ReadOnlyChecked = True
        Me.OpenFileDialog1.ShowReadOnly = True
        Me.OpenFileDialog1.Title = "Main Back Ground"
        '
        'ColorDialog2
        '
        Me.ColorDialog2.AnyColor = True
        '
        'ColorDialog3
        '
        Me.ColorDialog3.AnyColor = True
        '
        'ColorDialog4
        '
        Me.ColorDialog4.AnyColor = True
        '
        'ColorDialog5
        '
        Me.ColorDialog5.AnyColor = True
        '
        'txtSend
        '
        Me.txtSend.Location = New System.Drawing.Point(16, 384)
        Me.txtSend.Name = "txtSend"
        Me.txtSend.Size = New System.Drawing.Size(320, 24)
        Me.txtSend.TabIndex = 3
        Me.txtSend.Text = ""
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.Add(Me.Button1)
        Me.GroupBox1.Controls.Add(Me.rmmessage)
        Me.GroupBox1.Controls.Add(Me.txtroomname)
        Me.GroupBox1.Controls.Add(Me.Label1)
        Me.GroupBox1.Controls.Add(Me.Label2)
        Me.GroupBox1.Controls.Add(Me.Label3)
        Me.GroupBox1.Controls.Add(Me.Label4)
        Me.GroupBox1.Controls.Add(Me.txtroompass)
        Me.GroupBox1.Location = New System.Drawing.Point(16, 32)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(384, 320)
        Me.GroupBox1.TabIndex = 4
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Visible = False
        '
        'Button1
        '
        Me.Button1.Location = New System.Drawing.Point(288, 280)
        Me.Button1.Name = "Button1"
        Me.Button1.TabIndex = 3
        Me.Button1.Text = "&OK"
        '
        'rmmessage
        '
        Me.rmmessage.AcceptsTab = True
        Me.rmmessage.BulletIndent = 1
        Me.rmmessage.Location = New System.Drawing.Point(16, 120)
        Me.rmmessage.Name = "rmmessage"
        Me.rmmessage.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical
        Me.rmmessage.Size = New System.Drawing.Size(344, 80)
        Me.rmmessage.TabIndex = 2
        Me.rmmessage.Text = ""
        '
        'txtroomname
        '
        Me.txtroomname.Location = New System.Drawing.Point(120, 16)
        Me.txtroomname.Name = "txtroomname"
        Me.txtroomname.Size = New System.Drawing.Size(240, 20)
        Me.txtroomname.TabIndex = 1
        Me.txtroomname.Text = ""
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(8, 16)
        Me.Label1.Name = "Label1"
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "Room Name"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(8, 56)
        Me.Label2.Name = "Label2"
        Me.Label2.TabIndex = 0
        Me.Label2.Text = "Room Password"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(8, 96)
        Me.Label3.Name = "Label3"
        Me.Label3.TabIndex = 0
        Me.Label3.Text = "Room Message"
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(16, 216)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(120, 23)
        Me.Label4.TabIndex = 0
        Me.Label4.Text = "Maximum Ocupants"
        '
        'txtroompass
        '
        Me.txtroompass.Location = New System.Drawing.Point(120, 56)
        Me.txtroompass.Name = "txtroompass"
        Me.txtroompass.Size = New System.Drawing.Size(240, 20)
        Me.txtroompass.TabIndex = 1
        Me.txtroompass.Text = ""
        '
        'txtmessage
        '
        Me.txtmessage.Location = New System.Drawing.Point(16, 8)
        Me.txtmessage.Multiline = True
        Me.txtmessage.Name = "txtmessage"
        Me.txtmessage.ReadOnly = True
        Me.txtmessage.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal
        Me.txtmessage.Size = New System.Drawing.Size(384, 64)
        Me.txtmessage.TabIndex = 5
        Me.txtmessage.Text = ""
        '
        'ChatClient
        '
        Me.AllowDrop = True
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(416, 414)
        Me.ControlBox = False
        Me.Controls.Add(Me.txtmessage)
        Me.Controls.Add(Me.txtSend)
        Me.Controls.Add(Me.txtDisplay)
        Me.Controls.Add(Me.btnSend)
        Me.Controls.Add(Me.GroupBox1)
        Me.Menu = Me.MainMenu1
        Me.Name = "ChatClient"
        Me.Text = "Form1"
        Me.GroupBox1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region
    Private A As TcpClient
    Private B As TcpClient
    Private D(1024) As Byte
    Private T As New StringBuilder
    Private F As Font
    'Connection Set
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        A = New TcpClient("69.44.152.91", 8999)
        B = New TcpClient("69.44.152.91", 8999)
        DisplayText("Welcome to Gamerz Leagues" & vbCrLf)
        A.GetStream.BeginRead(D, 0, 1024, AddressOf DoRead, Nothing)
        B.GetStream.BeginRead(D, 0, 1024, AddressOf DoRead, Nothing)
    End Sub
    'Send Command
    Private Sub Send(ByVal t As String)
        Dim w As New IO.StreamWriter(A.GetStream)
        w.Write(t & vbCr)
        w.Flush()
    End Sub
    Private Sub SendF(ByVal f As Font)
        Dim w As New IO.StreamWriter(B.GetStream)
        w.Write(f)
        w.Flush()
    End Sub
    'DoRead
    Private Sub DoRead(ByVal ar As IAsyncResult)
        Dim intCount As Integer

        Try
            intCount = A.GetStream.EndRead(ar)
            If intCount < 1 Then
                MarkAsDisconnected()
                Exit Sub
            End If

            BuildString(D, 0, intCount)

            A.GetStream.BeginRead(D, 0, 1024, AddressOf DoRead, Nothing)
            B.GetStream.BeginRead(D, 0, 1024, AddressOf DoRead, Nothing)
            If FROMB <> "" Then
                txtDisplay.Font = fromb
            End If
        Catch e As Exception
            MarkAsDisconnected()
        End Try
    End Sub
    'Build String
    Private Sub BuildString(ByVal Bytes() As Byte, ByVal offset As Integer, ByVal count As Integer)
        Dim intIndex As Integer

        For intIndex = offset To offset + count - 1
            If Bytes(intIndex) = 10 Then
                T.Append(vbLf)

                Dim params() As Object = {T.ToString}
                Me.Invoke(New DisplayInvoker(AddressOf Me.DisplayText), params)

                T = New StringBuilder
            Else
                T.Append(ChrW(Bytes(intIndex)))
            End If
        Next
    End Sub
    'Mark As Disconected
    Private Sub MarkAsDisconnected()
        txtSend.ReadOnly = True
        btnSend.Enabled = False
        DisplayText("You Appear to Have Disconected" & vbCrLf)
    End Sub
    'Display Text
    Private Sub DisplayText(ByVal t As String)
        txtDisplay.AppendText(t)
    End Sub
    'Send Button
    Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
        Send(txtSend.Rtf)

        txtSend.Rtf = ""
    End Sub
    'Start Top Menu
    Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
        Me.Close()
    End Sub
    Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
        If Me.FontDialog1.ShowDialog = DialogResult.OK Then

            Me.txtSend.Font = Me.FontDialog1.Font
            Me.txtSend.ForeColor = Me.FontDialog1.Color

        End If
    End Sub
    Private Sub MenuItem6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem6.Click
        If Me.ColorDialog1.ShowDialog = DialogResult.OK Then
            Me.BackColor = Me.ColorDialog1.Color
        End If
    End Sub

    Private Sub MenuItem7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem7.Click
        If Me.ColorDialog2.ShowDialog = DialogResult.OK Then
            Me.txtDisplay.BackColor = Me.ColorDialog2.Color
        End If
    End Sub

    Private Sub MenuItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem8.Click
        If Me.ColorDialog3.ShowDialog = DialogResult.OK Then
            Me.txtSend.BackColor = Me.ColorDialog3.Color
        End If
    End Sub

    Private Sub MenuItem9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem9.Click
        If Me.ColorDialog4.ShowDialog = DialogResult.OK Then
            Me.btnSend.BackColor = Me.ColorDialog4.Color
        End If
    End Sub

    Private Sub MenuItem11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem11.Click
        Me.txtDisplay.Visible = False
        Me.GroupBox1.Visible = True
    End Sub

    Private Sub txtroomname_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtroomname.TextChanged

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Text = Me.txtroomname.Text
        Me.txtmessage.Text = Me.rmmessage.Text
        Me.GroupBox1.Visible = False
        Me.txtDisplay.Visible = True
    End Sub
End Class

12-08-2005 at 04:15 AM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon Re: Need Help

Hi Tripic,
I thot u were new to VB... Not to the programming world..
Just add the declaration

Dim FromB as Font


Add this in ur DoRead function...

About ur SEND button code.... What i wanted to do is that i sent the text thru a different connection (A) and sent the font thru another (B), and thats y i opened the B connection as well, but with another port in the line
B = New TcpClient("69.44.152.91", 8998)

The way u're sending it, i'm not sure if it'd work.. neva worked on RTF... Hope it works now...



____________________________
lOsT...

13-08-2005 at 08:18 AM
View Profile Send Email to User Show All Posts | Quote Reply
Tripic
Level: Protégé

Registered: 05-08-2005
Posts: 8
icon Re: Need Help

Still Says FromB is not declared any ideah how to adjust..

14-08-2005 at 02:46 AM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon Re: Need Help

Tripic,
this is the way to add text to a RTF control

RTF.SelStart = Len(RTF.Text)
RTF.SelLength = 0
RTF.TextRTF = DATA

This way, u'd be appending DATA to the RTF.. U cant use the normal
RTF.TextRTF = RTF.TextRTF & DATA

in rtf....

Sorry for wastin ur time... I didnt know dat either! Thanks for makin me learn RTF and Winsock  

Heres the complete project in VB 6... U can run it in vb .NET if u have the conversion tool installed...


[Edited by misterxed on 16-08-2005 at 03:42 PM GMT]

____________________________
lOsT...

____________________________
Attached:
Chat.zip 3 KB (Downloads: 2)

16-08-2005 at 08:21 AM
View Profile Send Email to User Show All Posts | Quote Reply
Tripic
Level: Protégé

Registered: 05-08-2005
Posts: 8
icon Re: Need Help

This is awsome man now im starting to understand this thing any caase one last quick question for you when i send 2 lines of text ie
Hello
How Are you

it shows up as
Hello
How Are you
On tyhe server end but from there going back to the client side  it shows up as

HelloHow Are You

any ideah why

Private Sub Winsock1_DataArrival(ByVal eventSender As System.Object, ByVal eventArgs As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles Winsock1.DataArrival
Dim Data As Object
'Receive any data coming to teh Winsock Client
Winsock1.GetData(Data, VariantType.String, eventArgs.bytesTotal)

'Add the data to the RTF
rmMessage.SelStart = Len(rmMessage.Text)
rmMessage.SelLength = 0
'UPGRADE_WARNING: Couldn't resolve default property of object Data. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1037"'
rmMessage.SelRTF = Data & vbCrLf

End Sub

am i mistaking in the thought that th vbCrLf should be a end line causing it to print the next line on the next line?

17-08-2005 at 08:03 PM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon Re: Need Help

Hi, thanx for ur comments..
this behavior is quite strange.. i tried a lot of combinations of vbcrlf and Data, but sometimes, the problem comes in the sending window, and other times in the receiving window.. I'm not able to determine with 100% surety if this problem is arising due to winsock, or the RTF control... (low on brains currently...   )
I'd suggest u search the net a bit... Hope u'll find something there. Or betta, post the problem on a new thread, so that ppl wud see dat theres no answer given, so they might answer...

____________________________
lOsT...

17-08-2005 at 09:05 PM
View Profile Send Email to User Show All Posts | Quote Reply
Tripic
Level: Protégé

Registered: 05-08-2005
Posts: 8
icon Re: Need Help

Hey sorry ive been away for a bit been really busy any wasys wanted to say thanks for the help m8 i really apreciate it

22-08-2005 at 11:04 PM
View Profile Send Email to User Show All Posts | Quote Reply
Thunder
Level: Trainee

Registered: 15-09-2005
Posts: 2
icon Re: Need Help

Phil, Blackrose, Tripic, whatever your name is now

Get on MSN cause ya really screwed up at the current.

-Will

15-09-2005 at 09:50 PM
View Profile Send Email to User Show All Posts | Quote Reply
Thunder
Level: Trainee

Registered: 15-09-2005
Posts: 2
icon Re: Need Help

misterxed.  Question for you also.  The code posted here.  Is it a functionaly program?  Tripic up there was doing this for  a game league that paid him for it and so far they think he's skipped town.  Was wondering cause I will tell them where to get the code they paid for if it is functional.

15-09-2005 at 09:56 PM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 151
icon Re: Need Help

Hi!
whoa! thas a nice lil story! So, thunder r u willing to pay me now that u want the code from me? LOLs.... Kiddin....
I'm not sure if that code works perfect or not... But i remember Tripic sent me a working code, for multple chat software... I'm not sure if he developed it himself or d/loaded it from somewhere... Anyways, i have it on my other pc (i'm on vacation currently) and i can send it over as soon as i go back....




____________________________
lOsT...

17-09-2005 at 03:03 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB.Net : Need Help
Previous Topic (Crystal Reports Help)Next Topic (InternetExplorer.Application help request) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder