Vertically Align ComboBox String Items

I'm trying to vertically align all the strings that are part of a combobox.  My code works fine when the combobox font name is Consolas, but it doesn't work when it's Microsoft Sans Serif (shown below).  Is there a way to make the combobox with
Microsoft Sans Serif font look like the one with Consolas?
Private Sub UpdateSizeDataSource()
Dim dtSizes As DataTable = CType(Me.cboSize.DataSource, DataTable)
Dim pixelPitch As String = Me.cboPixelPitch.SelectedItem.ToString
Dim charStartPosition As Integer
Dim columnName As String = Nothing
Dim standardSize As String = Nothing
Dim pixelMatrix As Size
If Me.rbtUS.Checked Then
columnName = "Imperial"
End If
If Me.rbtMetric.Checked Then
columnName = "Metric"
End If
charStartPosition = dtSizes.AsEnumerable.Max(Function(dr) dr.Field(Of String)(columnName).Length) + 2
For Each dr As DataRow In dtSizes.Rows
standardSize = dr(columnName).ToString
pixelMatrix = Me.GetPixelMatrix(dr("ValueMember").ToString, pixelPitch)
dr("DisplayMember") = String.Format("{0}{1}({2}x{3})", standardSize, Space(charStartPosition - Len(standardSize)), pixelMatrix.Height, pixelMatrix.Width)
Next dr
End Sub
Ryan

The only way i see of doing this is ether using a font that has a fixed width like Consolas, Courier New, or another OR by setting the combobox`s DrawMode to DrawFixed and using the DrawItem event to draw the text 1 character at a time at a fixed width apart.
However, the text in the Edit portion of the ComboBox would still be formatted with the font`s character widths.
 You may need to test different characters other than the underscore "_" in the line to get the maxwidth value. "M" is 13 pixels wide and "_" is only 10 but, it is just enough that the characters do not draw over each other.
If you use a Bold font style then you will need to switch it or some longer characters may get cut off a little.
 Here is an example of what i mean but, i am not familiar with using a DataSource for the Items so, i am not sure if you would need to change anything in the DrawItem event to get the text that is displayed for each item into the txt variable or not.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.DrawMode = DrawMode.OwnerDrawFixed
With ComboBox1.Items
.Add("10 X 30 Standard (180, 560)")
.Add("10 X 30 Max (180, 580)")
.Add("10 X 30 Standard (180, 560)")
End With
End Sub
Private Sub ComboBox1_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles ComboBox1.DrawItem
e.DrawBackground()
Dim txt As String = ComboBox1.Items(e.Index).ToString
Dim maxwidth As Integer = CInt(e.Graphics.MeasureString("_", ComboBox1.Font).Width)
Dim crect As New Rectangle(0, e.Bounds.Y, maxwidth, e.Bounds.Height)
For Each c As String In txt
Using sf As New StringFormat With {.Alignment = StringAlignment.Near, .LineAlignment = StringAlignment.Center, .FormatFlags = StringFormatFlags.NoWrap, .Trimming = StringTrimming.None}
Using sb As New SolidBrush(e.ForeColor)
e.Graphics.DrawString(c, ComboBox1.Font, sb, crect, sf)
End Using
End Using
crect.X += crect.Width
Next
End Sub
End Class
If you say it can`t be done then i`ll try it
No need to imitate a monospaced font. If ownerdrawing, you can just draw the parts of each string in regular columns.
thanks for any help

Similar Messages

  • How can I vertically align items that are in different regions

    Hello,
    I am a novice developer in APEX. I am creating a page which has 4 regions on it. Right now it looks like the following:
    ----region 1----------------------
    label: field label4: field
    -----region 2--- region 3--
    label: field label45: field
    -----region 4---------------------
    label:field [one-item-worth-of-space. next item aligned to right of item below]long_label: field
    label: field label: field
    I am trying to vertically align the items in these regions, in such a way that all the colons are vertically aligned.
    I am having a particular alignment problem in region 4, column 2 (item are bold). Both label:field, and long_label:field in region 4 have the same vertical/horizontal alignment option as the rest of the region (right for label, left for field). For some reason, there is one item space between these two items. This space is removed if I switch the two fields.
    I would really appreciate any help trying to understand
    - how to remove the one-item-equivalent space between two items in region 4
    - how to vertically align all these fields in different regions on one page.
    I tried to create the original scenario in bold, but the post would not allow space formatting. I apologise if it is difficult to understand
    Thank you in advance for your time.
    RHaq

    This is not the APEX forum. Post your question in this forum:
    Oracle Application Express (APEX)

  • VERTICAL ALIGNMENT ON WORD TABLE IS MISS.

    Hello everybody,
    Can somebody clear my mind? I did the code below, and this generates a beautiful and clean table on word 2010. The problem is that the instruction “.Rows.Height = 8” and 
    “.Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter” seems
     not work, besides, when I try to adjust the rows height and vertical alignment by myself, after routine generates the table of course, Word don´t allow me to do these adjustment by hand.
    The property “.Rows.Height = 8” seems to be working, because when I change to “.Rows.Height = 25” the rows height really goes to it, also, there is no problem with horizontal alignment, this is work very fine.
    Working with VS 2012 and Word 2010.
    Tried everything, no result….
    Thank you.
    Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
    Dim WA As New Word.Application
    Dim WD As Word.Document
    Dim WS As Word.Selection
    Dim model_address, mes_extenso, texto, texto_ref, pic_address As String
    model_address = Application.StartupPath & "\GTMS_MDL.docx"
    pic_address = Application.StartupPath & "\PIC\TABELA01.png"
    WD = WA.Documents.Open(model_address, [ReadOnly]:=True)
    WS = WA.Selection
    Dim WT1 As Word.Table
    Dim WR1 As Word.Range
    Dim lin_wt1, lin_wt2, lin_wt3 As Integer
    lin_wt1 = 3
    WT1 = WD.Tables.Add(WA.Selection.Range, lin_wt1 + 2, 5)
    With WT1.Range
    .ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
    .Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalBottom
    .Rows.Shading.BackgroundPatternColor = Word.WdColor.wdColorAqua
    .Rows(1).Shading.BackgroundPatternColor = Word.WdColor.wdColorBlueGray
    .Rows.Borders.OutsideLineStyle = Word.WdLineStyle.wdLineStyleSingle
    .Columns.Borders.InsideLineStyle = Word.WdLineStyle.wdLineStyleSingle
    .Font.Bold = True
    .Font.ColorIndex = Word.WdColorIndex.wdWhite
    .Rows.Height = 8
    .Columns(1).Width = 30
    .Columns(2).Width = 350
    .Columns(3).Width = 40
    .Columns(4).Width = 50
    .Columns(5).Width = 50
    .Font.Size = 7
    End With
    WT1.Range.Text = ""
    WT1.Cell(1, 1).Range.Text = "ITEM"
    WT1.Cell(1, 2).Range.Text = "DESCRIÇÃO"
    WT1.Cell(1, 3).Range.Text = "QTD."
    WT1.Cell(1, 4).Range.Text = "UNIT."
    WT1.Cell(1, 5).Range.Text = "SUBTOTAL"
    For i = 0 To lin_wt1
    WT1.Cell(i + 1, 2).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
    Next
    For i = 0 To lin_wt1 - 1
    WT1.Cell(i + 2, 1).Range.Text = i + 1
    WT1.Cell(i + 2, 2).Range.Text = DGV1.Rows(i).Cells(2).Value
    WT1.Cell(i + 2, 3).Range.Text = DGV1.Rows(i).Cells(3).Value
    WT1.Cell(i + 2, 4).Range.Text = DGV1.Rows(i).Cells(4).Value
    WT1.Rows(i + 2).Range.Font.ColorIndex = Word.WdColorIndex.wdBlack
    WT1.Rows(i + 2).Range.Font.Bold = False
    Next
    WT1.Cell(lin_wt1 + 2, 1).Merge(WT1.Cell(lin_wt1 + 2, 2))
    WT1.Cell(lin_wt1 + 2, 2).Merge(WT1.Cell(lin_wt1 + 2, 4))
    WT1.Cell(lin_wt1 + 2, 1).Range.Text = "TOTAL GERAL"
    WT1.Rows(lin_wt1 + 2).Range.Font.ColorIndex = Word.WdColorIndex.wdDarkRed
    WT1.Rows(lin_wt1 + 2).Range.Font.Size = 10
    WT1.Cell(lin_wt1 + 2, 1).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
    WT1.Cell(lin_wt1 + 2, 2).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
    WT1.Cell(lin_wt1 + 2, 2).Range.Text = FormatCurrency(12560, 2)
    WA.Visible = True
    WA = Nothing
    WD = Nothing
    WS = Nothing
    End Sub

    Hi,
    >>The problem is that the instruction “.Rows.Height = 8” and 
    “.Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter” seems
     not work, besides, when I try to adjust the rows height and vertical alignment by myself, after routine generates the table of course, Word don´t allow me to do these adjustment by hand.
    The property “.Rows.Height = 8” seems to be working, because when I change to “.Rows.Height = 25” the rows height really goes to it, also, there is no problem with horizontal alignment, this is work very fine<<
    I am not able to understand the issue exactly. Can you set the height for the rows using Rows.Height? I made a quick test using VBA based on the code above, it works well for me. And I can also adjust by hand after run the code.
    >> “.Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter” seems
     not work<<
    What effect did you want to achieve? Based on the code samlpe you were setting the verical alignment to bottom however the description are center. Both center and bottom for the vertical alignment works well for me.
    I would suggest that you test the code using a new document to see whether the issue is realtive to the specific document. Here is the test code in VBA for your reference:
    Sub test()
    Dim WA As New Word.Application
    WA.Visible = True
    Dim WD As Word.Document
    Dim WS As Word.Selection
    Dim model_address, mes_extenso, texto, texto_ref, pic_address As String
    'model_address = Application.StartupPath & "\GTMS_MDL.docx"
    model_address = "C:\doc1.docx"
    'pic_address = Word.Application.StartupPath & "\PIC\TABELA01.png"
    Set WD = WA.Documents.Open(model_address, ReadOnly:=True)
    Set WS = WA.Selection
    Dim WT1 As Word.Table
    Dim WR1 As Word.Range
    Dim lin_wt1, lin_wt2, lin_wt3 As Integer
    lin_wt1 = 3
    Set WT1 = WD.Tables.Add(WA.Selection.Range, lin_wt1 + 2, 5)
    With WT1.Range
    .ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
    .Cells.VerticalAlignment = Word.WdCellVerticalAlignment.wdCellAlignVerticalCenter
    .Rows.Shading.BackgroundPatternColor = Word.WdColor.wdColorAqua
    .Rows(1).Shading.BackgroundPatternColor = Word.WdColor.wdColorBlueGray
    .Rows.Borders.OutsideLineStyle = Word.WdLineStyle.wdLineStyleSingle
    .Columns.Borders.InsideLineStyle = Word.WdLineStyle.wdLineStyleSingle
    .Font.Bold = True
    .Font.ColorIndex = Word.WdColorIndex.wdWhite
    .Rows.Height = 8
    .Columns(1).Width = 30
    .Columns(2).Width = 350
    .Columns(3).Width = 40
    .Columns(4).Width = 50
    .Columns(5).Width = 50
    .Font.Size = 7
    End With
    WT1.Range.Text = ""
    WT1.Cell(1, 1).Range.Text = "ITEM"
    WT1.Cell(1, 2).Range.Text = "DESCRI??O"
    WT1.Cell(1, 3).Range.Text = "QTD."
    WT1.Cell(1, 4).Range.Text = "UNIT."
    WT1.Cell(1, 5).Range.Text = "SUBTOTAL"
    For i = 0 To lin_wt1
    WT1.Cell(i + 1, 2).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
    Next
    For i = 0 To lin_wt1 - 1
    WT1.Cell(i + 2, 1).Range.Text = i + 1
    WT1.Cell(i + 2, 2).Range.Text = "a" 'DGV1.Rows(i).Cells(2).Value
    WT1.Cell(i + 2, 3).Range.Text = "b" 'DGV1.Rows(i).Cells(3).Value
    WT1.Cell(i + 2, 4).Range.Text = "c" 'DGV1.Rows(i).Cells(4).Value
    WT1.Rows(i + 2).Range.Font.ColorIndex = Word.WdColorIndex.wdBlack
    WT1.Rows(i + 2).Range.Font.Bold = False
    Next
    WT1.Cell(lin_wt1 + 2, 1).Merge WT1.Cell(lin_wt1 + 2, 2)
    WT1.Cell(lin_wt1 + 2, 2).Merge WT1.Cell(lin_wt1 + 2, 4)
    WT1.Cell(lin_wt1 + 2, 1).Range.Text = "TOTAL GERAL"
    WT1.Rows(lin_wt1 + 2).Range.Font.ColorIndex = Word.WdColorIndex.wdDarkRed
    WT1.Rows(lin_wt1 + 2).Range.Font.Size = 10
    WT1.Cell(lin_wt1 + 2, 1).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
    WT1.Cell(lin_wt1 + 2, 2).Range.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
    WT1.Cell(lin_wt1 + 2, 2).Range.Text = FormatCurrency(12560, 2)
    WA.Visible = True
    Set WA = Nothing
    Set WD = Nothing
    Set WS = Nothing
    End Sub
    Hope it is helpful.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to set default for "Horizontal / Vertical Alignment"?

    Hi,
    is there somewhere a setting to change the default of the "Horizontal / Vertical Alignment" property for an item label? I don't like the "Right" alignment and I have to change it each time when I create a new item.
    Thanks
    Patrick
    http://inside-apex.blogspot.com

    Yes, this is one of (many) cases where a Bulk edit feature in the Builder would be very useful. There have been some discussions about this and hopefully the APEX team is considering these for the next release.
    Having said that, I frequently find myself taking a full app export and editing the SQL file in my favorite text editor (Vim) and making these little changes.
    This is NOT to be done lightly, see the caveats and disclaimers at Re: htmldb application Disabled(on updation of FLOWS_020000.WWV_FLOW_STEP_I
    As always, take a backup of the file before modifying it and save it so you can revert back to it if something goes wrong.

  • [svn:fx-trunk] 12982: Fix for issue with exposing accessible names for combobox list items

    Revision: 12982
    Revision: 12982
    Author:   [email protected]
    Date:     2009-12-15 20:44:23 -0800 (Tue, 15 Dec 2009)
    Log Message:
    Fix for issue with exposing accessible names for combobox list items
    QE notes: none
    Doc notes: none
    Bugs: n/a
    Reviewer: Gordon
    Tests run: checkintests
    Is noteworthy for integration: no
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/ComboBoxAccImpl.as
        flex/sdk/trunk/frameworks/projects/spark/src/spark/accessibility/ListBaseAccImpl.as

    Add this to the end of your nav p CSS selector at Line 209 of your HTML file, after 'background-repeat...':
    margin-bottom: -2px;
    Your nav p will then look like this:
    nav p {
              font-size: 90%;
              font-weight: bold;
              color: #FFC;
              background-color: #090;
              text-align: right;
              padding-top: 5px;
              padding-right: 20px;
              padding-bottom: 5px;
              border-bottom-width: 2px;
              border-bottom-style: solid;
              border-bottom-color: #060;
              background-image: url(images/background.png);
              background-repeat: repeat-x;
              margin-bottom: -2px;

  • Need Help about Vertical Align in TLF-

    I have added an InlineGraphicsElement in TextFlow which has some text in it. and i want to align the text verticalAlign.MIDDLE. ie. the text should be vertically aligned middle to the InlineGraphicsElement. rite now its bottom aligned. how can i make it to middle aligned like the attached image. please help me..?

    sabre150 wrote:
    So what makes you think that not using StringBuffer is the cause of the OP's problem?Just by experience. The main cause of resource hogs in Java is large string concatenation enclosed in a loop.
    I've just made the following experience :
    public class Test {
        public static void main(String[] args) {
            new Test().execute();
        private void execute() {
            long a, b, c;
            String value = "A123456789B123456789C123456789D123456789";
            String reply = "";
            StringBuffer buffer = new StringBuffer();
            a = System.currentTimeMillis();
            for (int i = 0; i < 5000; i++) { reply += value; }
            b = System.currentTimeMillis();
            for (int i = 0; i < 5000; i++) { buffer.append(value); }
            reply = buffer.toString();
            c = System.currentTimeMillis();
            System.out.println("Duration - concatenation = " + (b-a) + " / string buffer = " + (c-b));
    }Output :
    Duration - concatenation = 21295 / string buffer = 7

  • Vertical-align skinning not working

    I defined the following skin:
    af|selectManyCheckbox::item-text {
        padding-left: 5px;
        vertical-align: 10%;
        color: #333333;
    and the generated css is setting vertical-align to the default 35% value. Any reason?
    JDev 11.1.1.6

    Hi,
    Try adding
    vertical-align: 10% !important;
    Otherwise is most likely that you need to add the property to a different class.
    Regards

  • Tree control or multicolum​n listbox vertical alignment

    Hello, here is my problem: i use a tree and i need to resize it programmatically, so i change the height of all cells. When i resize it, there is no more vertical alignment between names(text) and tree's branchs.
    This problem even occurs with multicolumn listbox: when i resize cells, the text is no more vertical centered....
    Thanks a lot for any help
    Attachments:
    TreeVerticalAlignment.vi ‏15 KB

    So, now it's 2011. It seems like this issue has not been addressed yet. Any good work arounds? I'm trying to have larger rows without extraordinarily large text. I am using multiple lines to get the desired effect; however, the item symbols are vertically aligned to the top, so they don't look good.
    Thanks,
    Chris

  • Set vertical gap of menu items, list items...

    Hi, is there any way to adjust the vertical gaps between menu items, between list items, between combo box list lits? I am trying to make my Java application look like Windows application, but the vertical gaps in these Java components are just too big. Thanks!
    Yu

    Sorry for the massive bit of code, but you can use this to display the UI defaults and decide what to change if you want to try to affect (simple) global changes to the look and feel:
    It's far from beautiful but I've found it helpful from time to time.
    import javax.swing.JFrame;
    import javax.swing.Icon;
    import javax.swing.JLabel;
    import javax.swing.JScrollPane;
    import javax.swing.Box;
    import javax.swing.BoxLayout;
    import javax.swing.UIManager;
    import javax.swing.UIDefaults;
    import javax.swing.border.Border;
    import java.awt.BorderLayout;
    import java.awt.Graphics;
    import java.awt.Component;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.Insets;
    import java.util.Iterator;
    import java.util.Set;
    import java.util.TreeSet;
    import java.util.Comparator;
    import java.util.Enumeration;
    public class DefaultsDisplayer extends JFrame
         private static class ResourceLabel extends JLabel
              private ResourceLabel(Object key, Object value)
                   super(key.toString());
                   if(value instanceof Icon)
                        setIcon(new SafeIcon((Icon)value));
                   else if(value instanceof Color)
                        setIcon(new ColorIcon((Color)value));
                   else if(value instanceof Font)
                        setIcon(new ColorIcon(null));
                        setFont((Font)value);
                   else if(value instanceof Border)
                        setIcon(new ColorIcon(null));
                        setBorder(new SafeBorder((Border)value));
                   else if(value instanceof String)
                        setIcon(new ColorIcon(null));
                        setText(key.toString() + ": '" + value.toString() + "'");
                   else
                        setIcon(new ColorIcon(null));
                    setText(key.toString() + ": " + value.getClass().getName());
         private static class SafeIcon implements Icon
              private Icon icon;
              private SafeIcon(Icon icon)
                   this.icon = icon;
              public int getIconWidth()
                   return icon.getIconWidth();
              public int getIconHeight()
                   return icon.getIconHeight();
              public void paintIcon(Component comp, Graphics g, int x, int y)
                   try
                        icon.paintIcon(comp, g, x, y);
                   catch(Exception e)
         private static class ColorIcon implements Icon
              private Color color;
              private ColorIcon(Color color)
                   this.color = color;
              public int getIconWidth()
                   return 32;
              public int getIconHeight()
                   return 32;
              public void paintIcon(Component comp, Graphics g, int x, int y)
                   if(color == null)
                        return;
                   g.setColor(color);
                   g.fillRect(x, y, 32, 32);
         private static class SafeBorder implements Border
              private Border border;
              private SafeBorder(Border border)
                   this.border = border;
              public Insets getBorderInsets(Component c)
                   try
                        return border.getBorderInsets(c);
                   catch(Exception e)
                        return new Insets(0, 0, 0, 0);
              public boolean isBorderOpaque()
                   return border.isBorderOpaque();
              public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
                   try
                        border.paintBorder(c, g, x, y, w, h);
                   catch(Exception e)
         private static class ObjectComparator implements Comparator
              public int compare(Object o, Object p)
                   String s = o.toString().toLowerCase();
                   String t = p.toString().toLowerCase();
                   return s.compareTo(t);
         public DefaultsDisplayer()
              super("Default Displayer");
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              Box box = new Box(BoxLayout.Y_AXIS);
              UIDefaults defaults = UIManager.getDefaults();
              Set keys = new TreeSet(new ObjectComparator());
              for(Enumeration e = defaults.keys(); e.hasMoreElements(); )
                   keys.add(e.nextElement());
              Object key, value;
              JLabel label;
              for(Iterator i = keys.iterator(); i.hasNext(); )
                   key = i.next();
                   value = defaults.get(key);
                   label = new ResourceLabel(key, value);
                   box.add(label);
                   box.add(box.createVerticalStrut(5));
              getContentPane().setLayout(new BorderLayout());
              getContentPane().add(new JScrollPane(box), BorderLayout.CENTER);
              setLocation(50, 50);
              setSize(500, 500);
              doLayout();
              setVisible(true);
         public static void main(String[] args)
              new DefaultsDisplayer();
    }

  • How to display two-lines strings item

    Hi,
    How can I display list of two-line string items? Each Item in the list should have a phone number and a time. It should look similar to the "dialled numbers" display where each item has an image, and two-line string.
    Is it possible doing it with the high-level API or should I go low-level?
    Thanks in advance
    Imzadi

    use: list.setFitPolicy(Choice.TEXT_WRAP_ON)

  • How do I vertically align paragraphs in a page?

    I am new to Pages, and I've run across a problem that is really aggravating because it should not be rocket science... but it seems to be, at least for me.
    I need to center the text on the page so there is equal white space above and below it.
    In Word, you select File --> Page Setup --> Layout --> Vertical Alignment and choose "Center." Done.
    How do you do this Pages? I've scoured the manual and online help and can find nothing on this.
    Thanks in advance!

    Note that the Vertical Alignment does not apply to the Text Layer of a Word Processing document, just to the text in objects that accept text within the shape. For your application you would probably want to add a text box, centered on your page, to hold the text that you want to center.
    Regards,
    Jerry
    Message was edited by: Jerrold Green1

  • How to align a String value to the right side inside a table column?

    Hi,
    I have a text view inside a table column which is mapped to a string attribute. I need to align the text in the text view to the right hand inside the table column. But its always getting aligned towards the left side. I have tried by setting the <b>hAlign</b> property of Element properties of Text View to <b>right / forced right</b> but still the text is getting aligned to the left side.
    How do I align the String values in Text View towards the right hand side inside a Table Column?
    Thanks and Regards,
    Sayan Ghosh

    Hello Sayan,
    if i do get it right, you are adding an TextView element to a Table Cell. Then you should consider setting aligment within the particular cell. By calling:
    YourCell.setHorizontalAlignment(CellHAlign.RIGHT)
    regards.
    mz

  • Vertical alignment in cross-tab

    Hi,
    Anyone of you know how to align the measures Vertically Centered In Cross-tab report? As far as i know, there is option for Horizontal alignment; but no options for Vertical alignment. By default the text are docking on top aligned!!!
    Help me out to solve this or any work-around to achieve this?
    Thanks in Advance
    Viswa

    Hey Anindita,
    I was not asking about the text orientation. I want to align the text in the cross tab report to be vertically aligned center.
    I want the text in each cell should be aligned centered both horizontally as well as vertically. Horizontal alignment is available in cross tab formatting but not for the vertical alignment.
    Thanks
    Viswa

  • How to print vertical lines for line items?

    hi experts,
                    can any one tell me how to print vertical lines for line items in ascript?
    ive tried using sy-vline but its printing jus one line each for each item .i want it in columns ?if there are any control commands plz let me know how to print?
    thanks &regards
    narendar

    hi narendar,
    Welcome to SDN.
       u can go for box command.
    Use the box command with zero width for vertical lines.
    Position the line by x position and y postion.
    syntax :
    BOX <xpos> <ypos>
           <width>
          <height>
          <thickness in twips> twips.
    Regards,
    Arun.
    Reward points if useful.

  • Placing string item as a list option

    hi forum users i want to place the string item code which retrives server info as a list option but i do not know how to go abt it can anyone help thanks .
    /*if (infopool.containsKey("ServerInfo")) {//server info
                   res.removeCommand(Contents.ok);
                   infopool.remove("ServerInfo");
                   if (Datas.server_services.size() > 0) {
                        res.append(new util.CustomStringItem("Server Services:", res.getWidth()));
                        Vector serv = Datas.server_services;
                        for (int k=0;k<serv.size();k++) {
                             String lab = ((StringItem)serv.elementAt(k)).getLabel();
                             String name = ((StringItem)serv.elementAt(k)).getText();
                             res.append(new StringItem(lab+" ",name));
                   else
                        res.append(new StringItem("Server Info", " not available"));               
              else{*/
    thank you .

    hi forum users i want to place the string item code which retrives server info as a list option but i do not know how to go abt it can anyone help thanks .
    /*if (infopool.containsKey("ServerInfo")) {//server info
                   res.removeCommand(Contents.ok);
                   infopool.remove("ServerInfo");
                   if (Datas.server_services.size() > 0) {
                        res.append(new util.CustomStringItem("Server Services:", res.getWidth()));
                        Vector serv = Datas.server_services;
                        for (int k=0;k<serv.size();k++) {
                             String lab = ((StringItem)serv.elementAt(k)).getLabel();
                             String name = ((StringItem)serv.elementAt(k)).getText();
                             res.append(new StringItem(lab+" ",name));
                   else
                        res.append(new StringItem("Server Info", " not available"));               
              else{*/
    thank you .

Maybe you are looking for