how to have colored single border line for rich textbox and buttons in vb.net - vb.net

For rich textbox in vb.net i want to have single border line. Fixed single and Fixed 3D are having some dimensional effect which i do not want. And i would also like to change the color of the border.
And same thing with the button, for them how to have single line border and specified color.

According to the documentation, the richtextbox doesn't support FixedSingle, so it defaults to Fixed3D. You could put the RTB into a panel and set the RTBs border to none and the panel's border to fixed single.

Related

Is there any way to change the line height of a TextBox in a uwp app?

Is there any way to change the line spacing or line height of a TextBox in a uwp?
wpf:
TextBlock.SetLineHeigh(textboxName, 30)
but uwp is not allow?
Is there any way to change the line spacing or line height of a TextBox in a uwp?
UWP TextBox does not support set line height. Please use RichEditBox to replace.
Derive from rob's reply,
RichEditBoxcan represent rich text. The RichEditBox's underlying engine is more similar to the one in WordPad.
You can change the formatting in the RichEditBox by manipulating properties on the Document. You can set the line spacing by getting an ITextRange's ParagraphFormat and callingITextParagraphFormat.SetLineSpacing method.

How to center objects in parent with Dock Fill VB.NET

I'm trying to make a RichTextBox have fixed size and blank space flexible (like Word, WordPad), I made this:
Set Dock to Fill
Set MaximumSize to 600,0 (0 is wildcard for sizes) (Width=600 and Height=0 -wildcard)
I got this: blank spaces are flexible and RichTextBox size is fixed, but RichTextBox is not positioned at center.
I have some options:
Set padding to auto (I suppose that it's not possible)
Set margin to auto (I suppose that it's not possible AND margins not works in winforms)
What do I have to do to position RichTextBox to center?
Use anchor instead of dock.
Dock is designed for Size, Anchor is designed for Location
Your problem is based on location, locate your box to center instead of make Dock margins.

How to handle Segoe UI in pixel perfect layout (glyph "margin")

i am fighting with the layout of my windows store app. My problem is with the segoe ui font that I am using for the labels of some textboxes.
I have a borderless label above a textbox with a border like this:
LABEL
_____________
|__TEXTBOX___|
My problem is, that the font of the label does not align perfectly with the left border of the textbox.
First I though that it must be the label padding or something, maybe a padding or margin in the control template. But this is not the case. The true reason is the space around the glyphs within the font itself. Depending on the first letter or the size of the font the gap is bigger or smaller.
Is there a way to perfectly align the label text and the textbox independant of the first letter or the font size? Or do I really have to place every label in a different position to reduce this problem?

How to change DateTimePicker border color in VB .NET

Is there any easy way to change the border of DateTimePicker Control ? I want it to have a LightGray border to match my application theme. I also tried DateTimeInput control of DotNetBar, it has an option to change border color, but the DropDownButton in it has LightBlue theme. I have also tried adding an image to that button but it doesn't covers up whole button, the blue sides of the buttons are still visible.

XAML Theme Brushes - Switching Dynamically, cursor doesn't change

First Off, I found this extremely useful page on theme brushes:
http://metro.excastle.com/xaml-system-brushes
So Roughly, on startup for WinRT/XAML I am setting my theme brush for a textbox in a stylesheet:
Foreground = TextBoxDisabledForegroundThemeBrush
Background = TextBoxDisabledBackgroundThemeBrush
Which at run time makes the textbox appear as: white border, transparent background and grey text. Which I was hoping it would make it transparent, white border and white text.
On my Tapped event, I change the textbox to:
Foreground = TextBoxButtonPressedForegroundThemeBrush
Background = TextBoxButtonPressedForegroundThemeBrush
Which is supposed to be black background, white text and white border. Which seems right, but the cursor is back and you cannot see it.
First question is, am I doing this right to change my text color? I want to change the textbox so once it is selected it stays a changed color. I think this is correct. But I am not sure if I should be setting Foreground or maybe a Font Style instead?
Unfortunately you can't change caret color so if you want your TextBox editable - you should keep the background white or otherwise light. Otherwise, controlling the look of your control in its various states is best done using VisualStateManager and that is easiest to manipulate using Blend.