User Defined ToolTips

M

Mel Weaver

I have a user that wants to define his own tooltips hints for any
edit/combobox in the program. It is a multiuser window form application, so
the hints are for the other users. The backend is a sql server database.
I'm looking for ideas of how to readily identify the edit/combobox and store
the hint.

Mel
 
T

Tom P.

I have a user that wants to define his own tooltips hints for any
edit/combobox in the program.  It is a multiuser window form application, so
the hints are for the other users.  The backend is a sql server database.
I'm looking for ideas of how to readily identify the edit/combobox and store
the hint.

Mel

If I understand the issue correctly a simple table of "userid,
objectname, tooltip" should be acceptable.

Then on the form load you lookup the user and set each object's
tooltip text.

Tom P.
 
K

Ken Foskey

I have a user that wants to define his own tooltips hints for any
edit/combobox in the program. It is a multiuser window form
application, so the hints are for the other users. The backend is a sql
server database. I'm looking for ideas of how to readily identify the
edit/combobox and store the hint.

Mel

The following builds buttons from a database table and adds a tool tip
from the database. Gives you an idea on how to make this happen. I add
the row to the button so that I can have a generic click routine for all
buttons.

foreach (MyDataSet.tableRow dismissal in
DB.scoreDataset.table.Rows)
{
if (dismissal.IsButtonColumnNull())
{
continue;
}

RadioButton button = new RadioButton();
button.Appearance =
System.Windows.Forms.Appearance.Button;
// button.AutoSize = true;
int offset = dismissal.ButtonColumn > 2 ? 160 : 15;
button.Location = new System.Drawing.Point(10 +
((dismissal.ButtonColumn % 3) * 105), offset + (dismissal.ButtonRow *
35));
button.Name = String.Format("Name{0}", dismissal.ID);
button.Size = new System.Drawing.Size(100, 23);
button.TabIndex = 0;
button.TabStop = true;
button.TextAlign = ContentAlignment.MiddleCenter;
button.Text = dismissal.Description;
button.Tag = dismissal;
button.UseVisualStyleBackColor = true;
button.Checked = (dismissal.ID == 0);
button.CheckedChanged += new System.EventHandler
(DismissalCheckedChanged);

TypeGroup.Controls.Add(button);

if (!dismissal.IsTooltipNull())
{
toolTip1.SetToolTip(button, dismissal.Tooltip);
}
}


Ta
Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top