In my asp.net web site project I want to make rad calendar control smaller programmatically that get rendered by default to the browser(which is quite big for my requirement).I tried setting height and width of the control it doesn't work.How can I fix this?
RadCalendar calendar = new RadCalendar();
calendar.Width = x;
calendar.Height = y;
Panel1.Controls.Add(calendar);
Each of the Telerik Skins actually have a minimum height and width setting for the RadCalendar in order to ensure that the visual styles of the control are not broken. As you can imagine modifying the width and height to arbitrary settings could skew the look and feel of the control quite a bit. What you can do, however, is either modify one of the existing skins or create your own. This section in their online documentation covers how to change the appearance, and the specific article covers how to create a custom skin.
Related
I have an VSTO Outlook Add-in which shows a custom task pane (ctp). This ctp embeds a usercontrol which in turn contains an elementhost. The elementhost hosts an WPF user control.
At Add-in startup I create the ctp and I set it a fixed height, e.g. 120 points. I have noticed that depending on the screen resolution the ctp height gets smaller or bigger.
So I would like to know if there is a way to set the ctp height according to the current screen resolution so it does not get smaller or bigger.
For example some formula:
ctp.Height = Default_Height * Y_Scaling_Factor
I have tried setting the autoscalemode to font and dpi and it does not work.
You need to set the AutoScaleMode property to None if you don't want to get the container scaled according to the screen resolution.
The AutoScaleMode property specifies the current automatic scaling mode of this control. Scaling by Font is useful if you want to have a control or form stretch or shrink according to the size of the fonts in the operating system, and should be used when the absolute size of the control or form does not matter. Scaling by Dpi is useful when you want to size a control or form relative to the screen. For example, you may want to use dots per inch (DPI) scaling on a control displaying a chart or other graphic so that it always occupies a certain percentage of the screen.
For more information about automatic scaling, see Automatic Scaling in Windows Forms.
Also you may take a look at the AutoSize and AutoSizeMode properties that resize the form according to the setting of AutoSizeMode.
The title is my question and i searched the web and the doc of rtd but may be i did not know for what exactly i am looking because i am not a web-tech specialist.
I want to achieve that the toggle to the mobile layout appears earlier, at a wider width. I only need to increase the value by a few 100px.
How do you create a drop shadow on a button or label using Xamarin Forms. I am currently using Xamarin Forms 1.3 and trying to do this in XAML if possible. Does anyone have a working example they can point me to.
I have not tried this but you could create 2 instances of the same control and put them both inside a grid so that they lay directly over each other. Then with the first control (underneath) change the opacity to 0.2 so that it is very faint, then give it a small top and left margin so it sits slightly offset from the version above it. This should result in a drop-shadow type of effect.
A much better (but more involved) way of doing this is to subclass the controls you want to add the effect to and then create custom renderers to add the effect for each platform using native code
I want to add a CComboBoxEx on my form, but I have to align it with other controls and make it the same height.
The problem is that I can't find which is the correct way to get the height of this control.
If I set the window rectangle, that affects the drop down listbox. If I force it to be some fixed size, and the content inside the combo is higher, the control gets clipped at the bottom.
Is there a way to calculate how big the ComboBoxEx will be, based on image and current DPI settings? So that I could at least expand the other controls if I cannot adjust the internal padding of the control. MSDN doesn't touch the sizing issues at all as far as I've looked.
ComboBoxes set the height of the control automatically, and as you've discovered, trying to set your own height actually affects the height of the drop-down list.
To get the real height of the control (so you can resize your other controls) you can use GetWindowRect:
RECT rc;
GetWindowRect(hWndCombo, &rc);
int iComboHeight = rc.bottom - rc.top;
I don't know of a good way to change the height of the Combo control itself, and frankly I don't believe it's possible at least without lots of subclassing. I have implemented my own combo-style control because of this.
Although it probably won't help, you may also like to have a look at the GetComboBoxInfo() function to see if that provides any useful information.
For example, Windows Forms Designer offers to place my controls on the form the way there are 12 pixels between form border and control border. It seems too much to me. Is it standard value? Also, as I understand standard button height should be 23 pixels. Am I right? Is there any documents that state all this? And can I setup this default values in Visual Studio (for example what if want default margin between control and form borders, when the snap appears, to be 6 pixels instead of 12)?
You can always refer to the Windows User Experience Guidelines. It comes with a handy table of recommended control sizes. There are drawbacks in using pixel sizes, however.
I don't know of a way to control the snapping behaviour in Visual Studio, though. Apparently it can't be done. You can set a grid size, but it won't affect the dynamic snapping lines.
To change the snapping options, go to Tools > Options > Windows Forms Designer. There is a 'Layout Settings' category that include a setting called 'GridSize'.
As far as standards are concerned, I see them fading away with the arrival of technologies that focus on the user experience (WPF/Silverlight). Look at Expression Blend for instance. Not very standard, right? I think delivering a great user experience in each app is much more important than having a common GUI style across all apps.