Minimize/Maximize/Close buttons' tooltip and Devexpress lookAndFeel - c#

I'm trying to force Minimize/Maximize/Close buttons' tooltips (in ribbonform) to get a look from a lookAndFeel. So far I created a ribbonform, then I placed defaultLookAndFeel component on it ahd I chose an OfficeBlue skin. My ribbon form changed however the tooltips for control buttons(minimize,maximize,close) look the same. I also tried to use DefaultToolTipControler however changing properties on appearance section didn't get any results.
Is there any way to change appearance of tooltips mentioned before?

You're probably trying to get rid of the Aero integration.
Set AllowFormGlass to false.

Related

In a property grid is there a way to unselect all grid elements programatically?

I am working on a project in which I am using a property grid to display the properties of the selected control.
The Property Grid is fixed to the left edge of the container and in the rest of the space I have the form I am designing.
On clicking a control on the form, the specific control’s property is getting selected.
In the above figure, I have selected the textbox and the textbox’s properties get shown on the propertygrid.
Here if you observe, by default, the Name property is highlighted as well.
Is there some way to unselect this property programmatically?
I have tried some suggestions online but none have helped. I am not able to find find a way to remove all selections from the PropertyGrid, but its behaviour seem to be different form a DataGrid...
Here is why I need this...
On selecting a control, if a property in the property grid is selected, then the property is getting modified.
For example, If i cut the control using Ctrl + X, the selected value in property grid is getting cut which in some cases is forcing user to set the property before modifying anything on the form.
I have tried selecting multiple controls, but in that case alse the selected property seems to be persistent
Since PropertyGrid uses DefaultProperty to select a property in its grid, as an option you can set DefaultProperty attribute at run-time for your object to a non-browsable property, for example:
this.propertyGrid1.SelectedObject = null;
TypeDescriptor.AddAttributes(someControl,
new Attribute[] { new DefaultPropertyAttribute("Site") });
this.propertyGrid1.SelectedObject = someControl;
Well, what you are trying are hacks. It is never a good idea to do such hacks particularly if you are not the only person that use the software.
In your case, the focus should be on the designer while you interact with it. So if the user press Ctrl+X, the designer should respond to the keyboard and it should not have any effect on the property grid (as only one control can have the focus at the same time).
Thus it is up to you to make sure that your designer is focusable, that it has the focus when initially displayed, that it get the focus when you press the TAB key. Pressing the TAB key again should put the focus on the property grid so that user can interact with the grid without using the keyboard.
If you have more than these 2 controls, then obviously TAB should also stop at any appropriate controls. Also, it can be a good idea to have some direct shortcuts like F4 to (show and) activate the properties pane.
If you are not able to make it works, then the best compromise would be to use another windows for the properties grid. By using a distinct Tool windows for the properties, it should not respond to the keyboard when the main windows has the focus.
Here are some links that might help you:
Panel not getting focus
Control.Focus Method() — See Remarks section.
In any case, you should not prevent Ctrl+X to works as expected when the property grid has the focus and a property is selected. Users don't like software that do not follows UI conventions.
As a software developer, you should as much as possible ensure that your application follows standard behaviors. I recommend you that you take one or 2 extra days developing your software properly instead of doing hacks.
Often, compromise to gain a few days will never be fix and will be a pain for many years. Better to do it right from the start. Unselecting an item in the property grid is not an acceptable workaround. Your manager should not allows you to do that.

tooltip text property on user controls of system windows forms missing

After using C# a while, I recognized that the user controls of system windows forms don't provide a tooltiptext property like I am knowing it from Visual Basic 6.
I saw that the Form, TextBox, Label, ComboBox and PictureBox don't have such property.
Now I have the curious question:
How would I display a tooltip to the user on mousehover over a control like the above mentioned?
And Yes, I saw the "tooltip" control in the toolbox. It provides a baloon and I do not need a baloon.
It shows the tooltip for one item only once per user session and then never (known problem of the component) and why I would need an extra component, if this should be just a property of the corresponding control, for which I would like to provide a tooltip like TextBoxes, Labels etc.
And Yes, I saw the "Help Provider". I have usually never a help file assigned with my projects,
so I do not use the Help System. What I need is a simple Tooltiptext, not a "F1 component".
Now I am curious, how I would implement a Tooltiptext if the controls don't provide a option for it.
Can it be, that C# has no control tooltips? Even Delphi has! Or have I missed something somewhere?
The solution:
Delete all notifyicon controls from your project to ensure no unwanted info bubbles appearing
in the system tray.
Drag and Drop the Tooltip Component in Toolbox on your form, but ignore all the baloon properties and the baloon timeout properties and baloon timer properties, just Drag and Drop
the component without further action.
A weird new property field "tooltip on tooltip1" shows now up in all TextBoxes and Labels etc. on the form.
Just handle this field as it would be your Tooltip property and don't setup anything else in code
or on the designer. Build and compile. The tooltiptext will now show up as normal tooltip without
baloon functionality.
It sounds like you are using the ToolTip control incorrectly.
1- Drag it from the toolbox to your form.
At this point, each control on the form now gets a property "Tooltip" to set the appropriate text.
2- Set each control's new "ToolTip" property in the way you find most intuitive.

How to make something similar to Visual C# 2008 properties window?

What interests me is everything below the bar with buttons that determine how the properties are displayed. All I can figure out is there is a splitter and a status strip.
What I'm after is how there are 2 sections which I want to add the titles Property and Value, the sections can be resized with a splitter (I assume a splitter is used in this case), each property can be selected and the corresponding description appears on the status strip, and each value can either be text or a dropdown box.
The coding part I can probably do by myself, what I need to know is what controls the window is made up of and how it's put together.
You are referring to the PropertyGrid control. It's in the ToolBox.
See Getting the Most Out of the .NET Framework PropertyGrid Control
This is the PropertyGrid, and can be used directly. There is no need to reinvent the wheel here...

Change TextColor of disabled control

How to change the color of text, when a control is disabled.I want to set different color when control is disabled in c# winforms.
Edit: I had made the same mistake as Cody in the comments so corrected my answer.
It depends on which control it is.
For example, if it's a TextBox maybe you could make it ReadOnly instead of disabled. And for some other controls you might be able to do similar things to make them appear disabled without actually being disabled.
However, if you want to do it properly you need to make them Owner-draw or override the OnPaint event and draw the text yourself.
You can just do it manually -- when you disable the control, just change the text colour too?
If you have many controls, you can do this:
attach your form OnChildAdded event
in the event, use if ... is of type structure to determine control type
depending on the control type, register proper OnEnabledChange event
in the event, change text color appropriately
That way, you will have a piece of code that will work for all your forms and will gradually expand to use all the controls you need.
I'll provide some code if that's the way you want to go...

Winforms Creating Dropdown style panel

I am attempting to create my own custom Autocomplete style dropdown control in c# .net2.0. For speed of development I have built my control as a UserControl but have hit on an issue of doing it this way.
When the custom drawn dropdown gets drawn I have to resize the UserControl area to be able to display the list of options.
Ideally I want to be able to mimic the drodpown list behaviour in that the list of options is drawn 'floating' and is not constrained by the UserControls height and width (nor even the parent forms boundaries). A tooltip is another example of the unconstrained 'floating' that I desire.
The only way I can think of achieving this is to create on the fly a new form with no border or title bar and display this when the popup is required.
Is there a better (but also quick) way of doing this?
TIA
You would need to use a Form or NativeWindow to allow the control to float correctly. To make a form follow the control is easy enough but it is more difficult to implement and handle all of the focusing/hiding issues especially if you need seamless tabbing/key navigation.
You can try creating a control that is based off the ToolStrip Drop Down Button control. I believe that this control has the functionality that you are looking for. I found this reference for creating controls based off the ToolStrip, you might try starting with this.
http://blogs.msdn.com/jfoscoding/attachment/1335869.ashx

Categories

Resources