DshWinchester Posted January 9, 2011 Author Share Posted January 9, 2011 I am trying make the caption of a label be broken(like the LblNews in frmMenu) by sending a packet from server(command)The text is Ok but the lbl caption doesn't brokethis is my sub(Client>handledata)>! > Private Sub HandleQuestPic(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)> Dim Buffer As clsBuffer> Dim tmpArray() As String, I As Long> Dim tradeStatus As Byte> Dim Desc As String> Set Buffer = New clsBuffer> Buffer.WriteBytes Data()> > Desc = Buffer.ReadString> > Set Buffer = Nothing> > If Desc = "" Then frmMain.lblQuestDesc.Caption = "Sem missão"> > tmpArray() = Split(Desc, "< br / >")> frmMain.lblQuestDesc.Caption = vbNullString> For I = 0 To UBound(tmpArray)> frmMain.lblQuestDesc.Caption = frmMain.lblQuestDesc.Caption & tmpArray(I) & vbNewLine> Next> > End Sub anyone can tell me what I do wrong :rolleyes: Link to comment Share on other sites More sharing options...
Tdogthedog Posted January 9, 2011 Share Posted January 9, 2011 what do you mean by broke? Link to comment Share on other sites More sharing options...
DshWinchester Posted January 9, 2011 Author Share Posted January 9, 2011 breakable(like multiLine)~know the answer? :huh: Link to comment Share on other sites More sharing options...
Robin Posted January 9, 2011 Share Posted January 9, 2011 > tmpArray() = Split(Desc, "< br / >")There are spaces in your break tag. That needs to be written the exact same way as it is in the block of text you're wrapping. Link to comment Share on other sites More sharing options...
DshWinchester Posted January 9, 2011 Author Share Posted January 9, 2011 yes,I put spaces to apear on this msgelook if I put the real code> Private Sub HandleQuestPic(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)> Dim Buffer As clsBuffer> Dim tmpArray() As String, i As Long> Dim tradeStatus As Byte> Dim Desc As String> Set Buffer = New clsBuffer> Buffer.WriteBytes Data()> > Desc = Buffer.ReadString> > Set Buffer = Nothing> > If Desc = "" Then frmMain.lblQuestDesc.Caption = "Sem missão"> > tmpArray() = Split(Desc, "> ")> frmMain.lblQuestDesc.Caption = vbNullString> For i = 0 To UBound(tmpArray)> frmMain.lblQuestDesc.Caption = frmMain.lblQuestDesc.Caption & tmpArray(i) & vbNewLine> Next> > End Subsee?that part is disappearsstill dont break the caption :cry: Link to comment Share on other sites More sharing options...
Sputnak Posted January 9, 2011 Share Posted January 9, 2011 why not make it a RichTextBox? That could work, I dont think multiline is an option in labels. Link to comment Share on other sites More sharing options...
Robin Posted January 9, 2011 Share Posted January 9, 2011 @-sigh-:> why not make it a RichTextBox? That could work, I dont think multiline is an option in labels.It obviously does because it works just fine in Origins.It looks like you're just not duplicating my code properly. Post a dump of the received packet text. Link to comment Share on other sites More sharing options...
DshWinchester Posted January 9, 2011 Author Share Posted January 9, 2011 Textbox is easy but isnt transparentthanks :P~~~~I call this>! Sub QuestPic(ByVal Index As Long, ByVal Desc As String) Dim Buffer As clsBuffer Set Buffer = New clsBuffer Buffer.WriteLong SQuestPic Buffer.WriteString Desc SendDataTo Index, Buffer.ToArray() Set Buffer = NothingEnd Subquestpic "teeeeeeeeeeeeeeeeeeeestttttttttttaweawwwwwwwwwwwwwpie"the only diference between lblNews and my label is that my text message is a packetty :cheesy: Link to comment Share on other sites More sharing options...
Robin Posted January 9, 2011 Share Posted January 9, 2011 Post an actual dump of the text the client receives. Link to comment Share on other sites More sharing options...
DshWinchester Posted January 9, 2011 Author Share Posted January 9, 2011 ._. the problem was the lack of spaces.The label does not break if a single word.before![](http://img205.imageshack.us/img205/1517/screenhunter06jan090809.png)now![](http://img832.imageshack.us/img832/5913/screenhunter04jan090805.png)well,thanks for the code and patience XDI just post here cause I am making others thing of my game and very busy '-' Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now