Applying Style Dynamically To MultiButton LineX Labels - codenameone

I want to apply RoundBorder style to MultiButton Line2 label when horizontal layout is set to true but calling mb.setHorizontalLayout(true); but I can't because LineX labels are not accessible outside the MultiButton.
I know that I can create curved border using theme designer and applying the uiid to the label using any of the setUIIDLineX() method but I don't want to use it because it didn't give me what I want in some device pixel density.
Is there any other way to style MultiButton internal components(Labels) through code?
Again, why is it that LineX labels are not exposed like icon label?
Exposing the LineX labels will equally enable developers to set icons for the individual labels depending on what the developer want to accomplish.
Thanks.

No one asked for that so we didn't add such getters. You can file an RFE for that or submit a pull request which will probably be quicker.
Notice you can style the round border in the current version of the designer so you can use a the UIID's to set the round border too.

Related

How to change the border color in DB-Visualizer?

I am using DB-Visualizer 9.2.10 and I want to change the border color of the editor but I don't see any border option to change. Below image shows the options colors and borders but in my pro version I don't see this option. Is there any other way to accomplish the same.
Thanks
You should be able to change the border by going to Tools -> Properties.
You can either select one of the predefined styles or specify a small image file to use for the border.
You should also be able to change it by going to Database -> Connections

Why is the Designer in Codename one not reporting the attributes I set?

I started a Codename One project with the "Hello World bare bones". I used to define the styles in the Theme tab from the Designer but now it is becoming tedious.
Actually for some selectors, even if I override (unchecking the Derive box) some properties the style is not changed in the Designer (see below) or in the app itself.
However, in the list of selectors, the color is not the one I selected but the alignment seems to be it.
It seems that the theme is locked somewhere. Do I make a mistake, or should I set a constant to "unlock" the theme, or even should I clear some directories?
Please note that I am using NetBeans with designer V 1.1
.
Edit March 1st 2017
Following #Diamond's great tips, I was able to change the foreground color by setting the Border to empty (instead of NULL). However now the alignment is still not what I expect (see below). How can I do for this property ?
Any help appreciated,
In the Designer, Border is superior to background color and background image. Which means if the border image is set, a background color will have no effect unless the border is just a stroke or line.
Always solve this with these few steps:
Go to the Border tab and uncheck the override.
Click the ... button next to Border Help and a new Dialog will show.
Change the Type (First line) to Empty and click Ok.
Your background color will now have an effect.

Can't change backcolor of TabPage with DevExpress WinForms XtraTab

I'm using a DevExpress WinForms XtraTab control v11.2 and I can't get the tab page background color to change. It's stuck on transparent. I've set colors on the XtraTab's AppearancePage.PageClient and there was no effect.
If you throw a default XtraTabControl out you get two tabs that are both white in the main area. I want this area to be grey.
In addition to what you're doing, set the XtraTabControl's PaintStyleName to Standard or PropertyView or one of the other non-Default styles to get the look you want:
Here's an example of dragging in the XtraTabControl and only changing the PaintStyleName property:
If the control's look and feel is set as skin then from what I'm aware you can't change the backcolor.
In order to actually do so you have two options:
1) Use devexpress SkinEditor utility to create a skin with the colors you want.
2) Set default look and feel to false, the style to flat, then you will be able to choose what color you want (keep in mind since you will be disabling the skin it won't look as good so the first option might be better).
this.xtraTabControl1.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.Flat;
this.xtraTabControl1.LookAndFeel.UseDefaultLookAndFeel = false;
this.xtraTabControl1.TabPages[0].BackColor = System.Drawing.Color.Gray;

How to resize multiple WPF controls when the text size changes?

What's the correct pattern to resize controls when a font size changes?
For example, I used the WPF designer to make a form, and placed UI elements from the toolbox. Late in the game I got the requirement that the font size of every UI element needs to be configurable, so now I'm thinking there has to be a better way to resize controls when the font size changes. Right now I'm doing alot of code behind calculations on Margin properties.
For such cases I usually place my control inside Grids and StackPanels, this way font size won't affect the layout, everything will be stretchable.
Never place controls on the Window using absolute coordinates.
Make sure your Height and Width on the controls are set to Auto.
When you use the designer/toolbox to add controls it usually provides a static height/width. If you type the tag in the XAML editor you get the control default which is usually Auto.
You'll notice the black diamond in the property window next to the attributes that are changed from their default value. You can right click and choose reset value to clear the attribute from your XAML and see what the default value is.

How can I center a tooltip above my control in Silverlight?

I want to be able to display a tooltip centered above my control.
I know how to customize the XAML used to display the tooltip using the TooltipService, however, the placement options the TooltipService makes available only allow you to specify top, bottom, left, right, etc. They don't let you specify an alignment once on the given side.
By simply using the TooltipService, selecting a placement of "Top" puts the tooltip above the control and has it aligned to the left side of the control. If there is not enough room for it to be aligned left, it moves it to be aligned on the right side of the control.
I want the tooltip to be centered on the top of the control. I don't want it to anchor to either the left or the right while on top.
Is this possible? How?
you should check out the TooltipService. MSDN documentation is here. and here is a (WPF) sample from CodeProject.
A quick shot: you could create your own TooltipService class to extend the possibilities of the existing one to manipulate a Tooltip instance.
Here you can find a nice class to help position a popup by specifying a list of preferred positions, like the TooltipService does for tooltip. You can specify a Top placement with Center HorizontalAlignment. I know this isn't a tooltip but I thought you could check it out and use it to create a BetterTooltipService.

Resources