CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2009
    Posts
    12

    Question AxMSChart rowlabel

    Hi,

    Current code:
    AxMSChart1.RowLabel = "aaa" & ", " & "bbb"

    How to write the code, so it'll appear as

    aaa
    bbb

    instead of aaa, bbb?

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: AxMSChart rowlabel

    You'd have to split the string into values, then use this, to strip out the center value


    Code:
    Dim a as string = "aaa" : Dim b as string = "a, " : Dim c as string = "bbb" 
    String.Format({0}{1}{2}", a, Environment.NewLine, c)
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Mar 2009
    Posts
    12

    Re: AxMSChart rowlabel

    Quote Originally Posted by dglienna View Post
    You'd have to split the string into values, then use this, to strip out the center value


    Code:
    Dim a as string = "aaa" : Dim b as string = "a, " : Dim c as string = "bbb" 
    String.Format({0}{1}{2}", a, Environment.NewLine, c)
    You mean AxMSChart1.RowLabel = String.Format("{0}{1}{2}", a, Environment.NewLine, c) ?

    i still get "aaabbb" instead of

    aaa
    bbb.

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: AxMSChart rowlabel

    Try this:

    Code:
    AxMSChart1.RowLabel = String.Format("{0}{1}", a & Environment.NewLine, c) ?
    or

    Code:
    AxMSChart1.RowLabel = String.Format("{0}{1}", a & vbCrLf, c) ?
    or use Environment.NewLine as b, and print a,b,c

    Is your label set to MultiLine? That's probably the answer, now that I think of it
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Mar 2009
    Posts
    12

    Re: AxMSChart rowlabel

    Quote Originally Posted by dglienna View Post
    Try this:

    Code:
    AxMSChart1.RowLabel = String.Format("{0}{1}", a & Environment.NewLine, c) ?
    or

    Code:
    AxMSChart1.RowLabel = String.Format("{0}{1}", a & vbCrLf, c) ?
    or use Environment.NewLine as b, and print a,b,c

    Is your label set to MultiLine? That's probably the answer, now that I think of it
    Still cannot haha.. The AxMSChart don't have the multiline function. =x

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: AxMSChart rowlabel

    Set the HEIGHT to double and try
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured