You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tested Tools property for TextBox and it looks great. Window/Forms will now be free from so many lookup buttons and it will be cleaner now. But can you make it visible only when the control has focus even if it's Visible property is set to true.
We can add a property to the tool to hide it when losing the focus. Will log it as an enhancement. It's easy to add.
All the cell editors use the equivalent edit control. You can alteady add the tools if you override or attach the edit initialization event. I will add an enhancement to make the property Tools available for the applicable DGV cell classes.
I'm trying to get a Tools in a Textbox, but as soon as I add a Tool to the tools collection, the form becomes invisible. What am I missing? Can you share a piece of implementation code? Below the code I'm using.
Best,
Alex
.............................................
var fOtherForm = new Form();
fOtherForm.MdiParent = this;
fOtherForm.Show();
var text = new TextBox();
text.Left = 100;
text.Top = 100;
fOtherForm.Controls.Add(text);
var tools = new ComponentToolCollection(text);
var tool = new ComponentTool();
tool.Position = LeftRightAlignment.Left;
tool.ToolTipText = "Push this to get magic!";
// Up to here, the TextBox is visible in the form, after the following line I get an empty screen!
Thanks for your answer. But I can't make it work. I do the same as the steps you mention, but in my code, not using the designer. As soon as I create the ComponentTool, i.e. uncomment the first of the commented out lines in the following, I get and empty screen....
Thanks again.
Alex
public partial class Window7 : Form
{
public Window7()
{
InitializeComponent();
var text = new TextBox();
text.Left = 100;
text.Top = 100;
this.Controls.Add(text);
//var tool = new ComponentTool();
//tool.Position = LeftRightAlignment.Left;
//tool.ImageSource = "tab-close";
//tool.ToolTipText = "Push this to get magic!";
//text.Tools.Add(tool);
}
}
There's nothing wrong with your code. I tryed it on my own project (copy&paste) and it runs all right. So... other than suggesting a computer restart :), I can't help you.
I don't know why I have my picture here. There is no registration at all. I use my Gmail address on all comments. I guess my pivture comes my Gmail account..
Wordpress and other CMS read the gravatar from gravatar.com, which in turn probably loads them from various providers. Your gravatar is the md5 hash of your email address:
Activity
itg-assistant commentedon Jun 12, 2026
Luca answered 2016-07-25 14:44:49 UTC
Hi Cris,
We can add a property to the tool to hide it when losing the focus. Will log it as an enhancement. It's easy to add.
All the cell editors use the equivalent edit control. You can alteady add the tools if you override or attach the edit initialization event. I will add an enhancement to make the property Tools available for the applicable DGV cell classes.
Best,
Luca
itg-assistant commentedon Jun 12, 2026
Cris answered 2016-07-25 14:51:39 UTC
Hi Luca,
That's great. It seems that the framework is very flexible and it's always ready for an enhancement.
Regards.
itg-assistant commentedon Jun 12, 2026
Tiago Freitas Leal answered 2016-08-26 09:15:25 UTC
Hi Luca,
There are 2 issues on this thread:
add a property to the tool to hide it when losing the focus - what's the status on this?
make the property Tools available for the applicable DGV cell classes - as far as I tested, this isn't ready (at least for DataGridViewTextBoxCell).
itg-assistant commentedon Jun 12, 2026
Alex Prinias answered 2016-08-26 10:05:08 UTC
Hi guys,
I'm trying to get a Tools in a Textbox, but as soon as I add a Tool to the tools collection, the form becomes invisible. What am I missing? Can you share a piece of implementation code? Below the code I'm using.
Best,
Alex
.............................................
var fOtherForm = new Form();
fOtherForm.MdiParent = this;
fOtherForm.Show();
var text = new TextBox();
text.Left = 100;
text.Top = 100;
fOtherForm.Controls.Add(text);
var tools = new ComponentToolCollection(text);
var tool = new ComponentTool();
tool.Position = LeftRightAlignment.Left;
tool.ToolTipText = "Push this to get magic!";
// Up to here, the TextBox is visible in the form, after the following line I get an empty screen!
tools.Add(tool);
............................
itg-assistant commentedon Jun 12, 2026
Tiago Freitas Leal answered 2016-08-26 10:33:39 UTC
Hi Alex,
I just used the designer and to add componentTool1 Tool to txtAddress TextBox it generated the following code:
and also the event handler
itg-assistant commentedon Jun 12, 2026
Tiago Freitas Leal answered 2016-08-26 11:34:48 UTC
As per 2.1.40.0, replace
by
This same version introduces cell Tools. Use the designer and set the Tools on the relevant column. You must also set CellToolClick event handler.
itg-assistant commentedon Jun 12, 2026
Luca answered 2016-08-26 12:20:28 UTC
Hi Tiago,
The property to hide the tools when losing the focus is not there yet. It needs to be defined better.
All DGV columns with editors that support tools have the Tools property and are all implemented.
Best,
Luca
itg-assistant commentedon Jun 12, 2026
Luca answered 2016-08-26 12:23:06 UTC
Alex,
One of the previous builds had a problem with tools that caused the creation of the widgets to stop.
Best,
Luca
itg-assistant commentedon Jun 12, 2026
Alex Prinias answered 2016-08-26 12:31:25 UTC
Hi Tiago,
Thanks for your answer. But I can't make it work. I do the same as the steps you mention, but in my code, not using the designer. As soon as I create the ComponentTool, i.e. uncomment the first of the commented out lines in the following, I get and empty screen....
Thanks again.
Alex
public partial class Window7 : Form
{
public Window7()
{
InitializeComponent();
var text = new TextBox();
text.Left = 100;
text.Top = 100;
this.Controls.Add(text);
//var tool = new ComponentTool();
//tool.Position = LeftRightAlignment.Left;
//tool.ImageSource = "tab-close";
//tool.ToolTipText = "Push this to get magic!";
//text.Tools.Add(tool);
}
}
itg-assistant commentedon Jun 12, 2026
Tiago Freitas Leal answered 2016-08-26 14:56:30 UTC
Hi Alex.
There's nothing wrong with your code. I tryed it on my own project (copy&paste) and it runs all right. So... other than suggesting a computer restart :), I can't help you.
itg-assistant commentedon Jun 12, 2026
Alex Prinias answered 2016-08-26 16:15:24 UTC
Dear Tiago,
I didn't need to restart! In fact, after updating to the latest wisej version (1.2.40), my tools showed up.
Many thanks for your help.
Alex
itg-assistant commentedon Jun 12, 2026
Alex Prinias answered 2016-08-26 16:19:35 UTC
Dear Tiago,
By the way, I was wondering how come you are the only one with a picture next to your name... Have I missed some registration procedure?
Best,
Alex
itg-assistant commentedon Jun 12, 2026
Tiago Freitas Leal answered 2016-08-26 16:27:02 UTC
I don't know why I have my picture here. There is no registration at all. I use my Gmail address on all comments. I guess my pivture comes my Gmail account..
itg-assistant commentedon Jun 12, 2026
Luca answered 2016-08-26 16:34:49 UTC
Wisej has taken control of your pc camera. :)
Wordpress and other CMS read the gravatar from gravatar.com, which in turn probably loads them from various providers. Your gravatar is the md5 hash of your email address:
http://2.gravatar.com/avatar/ef0ce49f10322041268292d4c74952ba"
https://en.gravatar.com/site/implement/hash/
If you set up a profile image in gmail it will be used by all sites reading gravatars.