Embed a control inside a Tooltip in WinForms - c#

is it possible to add a control to a tooltip?
What im trying to achieve is a tooltip that shows some example data in a dataGridview inside the tooltip.
What I have done so far is the following:
I have created a table with some settings (dataGridview with Name (text), Type (text), Example (image), and Setting (comboBox).
I managed to show a tooltip with the example as string onMouseOver the example image.
I'd like to embed another dataGridview in the tooltip because some examples are in table form.

Tooltips are very limited.
The solution is to create a custom tooltip. You do a form and make it look like a tooltip and you put on it what you want.
You can make it look exactly like a tooltip an you can show it and hide it with the event handlers on your datagrid.

My solution was to use a custom panel that shows up on the cursors position and fade out after a timer has reached end.

Related

Referenced custom control for windows form groupbox displays incorrectly

So the custom control form looks like this:
http://imgur.com/7Udg7wd,0PivXdl,4fHdmGt
However, whenever I reference this custom control, OAuthControl.cs, the groupbox of which the buttons and textboxes are organized under displays incorrectly. Here is a picture:
http://imgur.com/7Udg7wd,0PivXdl,4fHdmGt#1
I tried changing the margin and padding properties for that groupbox and only got it to partially display more of the bottom half.
What can I change to make each control that I reference in a new form to conform to the original control design?
Sorry, I can't comment under your question.
Probably is related to Anchor (I immagine that buttons ar anchored) or something you do in OAuthControl.cs
Could you post it?

Configure the selected control's Text of the user Control

I am creating a group of panels with labels in it. Depending on the requirement of the User. Kind of mimicking the Tab control here. Where like the Tab control's Title is editable, i would let the user to configure the name of the labels at design time. How possibly can i achieve it?
In the event Handler of the Label, change the label to a TextBox. When the TextBox looses focus, replace it with a Label again
Please chehk the following thread (Header Editable Tab Control in WPF).
If you use WPF, then this is exactly what you need for your work. If you use another template, maybe still can add some tips. :)
Good luck

How to make message entry/list/view in C#

He I am a beginner to C# and I am working on a reaction manager plug-in for some bigger project. (Yes I am a intern)
Now I just can't find a way to create a view similar to this:
My full design:
How to realize this design? I cant find any default templates in the devexpress which are suitable for this. I come from php and in php I can use html. I am a beginner to C# and I don't have any clue on how t do this. Do I have to use canvas to literally draw this? OR is there a standard template I can use for this purpose.
You have many comment boxes that contain the same layout - a label comment text, author name, date, etc. There is no control that lays things out like that, you will have to make your own custom control (Project->Add User Control). This control will be a composite control - ie made up of other controls. Probably a label for each text field (comment, author, date, etc) laid out in the right places. Maybe call it CommentBox or something.
Then in the main form you now have available CommentBox controls which you can add to the form. Create a panel to put them in so you have many CommentBox controls in the panel, one for each comment (or maybe add them at runtime).
Now in WPF it's slightly easier because there is a StackPanel control that you can simply add controls to and it automatically arranges them vertically one beneath another in a stacked list. In fact your use case is exactly fitting what a StackPanel is for.
In WinForms there is no StackPanel, but you can use a normal Panel control*. It's just you'll have to position the CommentBox controls manually one beneath another. You will also need to set the AutoScroll property to true to turn on the vertical scroll bar if the content doesn't fit the view.
*or there's apparently an alternative How can I get a StackPanel-like layout in WinForms

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 does ToolTip show Popup on a control?

When set a TooltipText on a control, and the tooltip text will be shown when user move mouse on the control. Tooltip will detect MouseEnter or MouseLeave or anything for this purpose?
I want to know how does a Tooltip show Popup on a control?
Assume that I have a user control with name 'UserControlX'. On UserControlX, I put a button and set Dock property to Fill. I add a UserControlX on Form1, add a ToolTip and set a text to this usercontrol. ToolTip will be not shown when user move mouse on control because user is moving mouse on usercontrol's button, not usercontrol, so the tooltip will never show.
Please help me how to solve this problem so that when move mouse on UserControlX, the tooltip will be shown. Thanks.
I believe the tooltip displaying on mouse-over is defined within the control's default template. if you view the default template you will likely see a reference to a tooltip in there. If you go further and view the Tooltip's default template, you will see how it is composed as well as what events it listens to.
To answer your question, you could do what Adrian suggests and put the tooltip on the button as well as the parent control.
If you have time to mess around a bit, you COULD try to see if there is a tooltip displayed event or something to that effect for the button, and then simply invoke the parent control's tooltip manually. It could be considered a hack, but worth a try, maybe.

Categories

Resources