Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7646207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:08:55+00:00 2026-05-31T10:08:55+00:00

This code(below) suppose to add information to ToolTips which are taken from database(and the

  • 0

This code(below) suppose to add information to ToolTips which are taken from database(and the class Codons does it(it is the part that actually works)). I tried to do it in FOR loop, but it is warning me about this line:

toolTip1.SetToolTip(Convert.ToString(letter),"Name: "+fullname+" ("+cdn.GetCodon1()+")"
                          +"\n Begin: "+cdn.GetStart()+", End: "+cdn.GetEnd()+"");

I have 20 buttons which are named in a-z letters, except 6 specific letters(see the IF inside the FOR)

Here is the CODE:

private void UpdateToolTipButton()
{
  string fullname;
  Codons cdn;
  char letter='a';
  //get info about every amino acid from database
  OleDbConnection  dataConnection = new OleDbConnection();
  dataConnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Projects_2012\\Project_Noam\\Access\\myProject.accdb";
  dataConnection.Open();
  for(int i=1;i<=26;i++,letter++)
  {
    if((letter!='b')&&(letter!='e' )&& (letter!='j') && (letter!='o')&& (letter!='u') && (letter!='z'))
    {
      OleDbCommand datacommand = new OleDbCommand();
      datacommand.Connection = dataConnection;
      datacommand.CommandText = "SELECT tblCodons.codonsFullName"
                     +" FROM tblCodons"
                     +" WHERE tblCodons.codonsCodon1="+letter;   

      OleDbDataReader dataReader = datacommand.ExecuteReader();
      dataReader.Read();
      fullname = dataReader.GetString(0);
      cdn = new Codons(fullname);

      toolTip1.SetToolTip(Convert.ToString(letter),"Name: "+fullname+" ("+cdn.GetCodon1()+")"
                          +"\n Begin: "+cdn.GetStart()+", End: "+cdn.GetEnd()+"");
    }
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:08:56+00:00Added an answer on May 31, 2026 at 10:08 am

    SetToolTip is looking for a control as the first argument. You are supplying Convert.ToString(letter).

    The first argument needs to be the button you want to have the tooltip:

    toolTip1.SetToolTip(button1, "Name: " + fullname);
    

    I’m guessing you were trying to set the title of the ToolTip, in which case, that’s not part of the SetToolTip method. You would have to set the property yourself:

    toolTip1.ToolTipTitle = Convert.ToString(letter);
    

    If your buttons are those letters, then you would reference them by their name as the control key:

      if (this.Controls.ContainsKey(Convert.ToString(letter))) {
        toolTip1.SetToolTip(this.Controls[Convert.ToString(letter)], "Name: " + fullname + " etc(";
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically this code below returns the right information, but I need to add the
This should be a fundamental C# question. Suppose I have a Person class which
I have the code below which is supposed to check the database for entries
This code below is for executing ls -l | wc -l. In the code,
This code below works in all web browsers except IE: <input type="text" name="passwordLogin" value="Password"
i am using this code below to dynamically capture the name of the button
I have this code below. As you can see I am passing two variables
Hi I'm using this code below to let a user draw their signature on
How can this code compile? The code below in the operator int CAN access
I have this javascript code below that uses jquery, it is suppoed to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.