Results 1 to 4 of 4

Thread: adding tooltip to dynamic controls [resolved]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member Sneeden's Avatar
    Join Date
    Oct 2001
    Location
    Sneedville
    Posts
    258

    adding tooltip to dynamic controls [resolved]

    I am adding a grid of command buttons to a user control. I am having trouble adding the tooltiptext at runtime. I have a tooltip control added to the user control form. Here is the code where I want to add it:

    Code:
    int x=0,y=0;
    p_socks=new Button[iX,iY];
    try
    {
    	for(x=0;x<iX;x++)
    	{
    		for(y=0;y<iY;y++)
    		{
    			//set socket's back color to default backcolor;
    			//p_sockColor[x,y]=p_defaultColor;
    
    			//no need to create sockets again
    			if(socketsCreated)
    				return true;
    
    			//generate socket name
    			string butName=x.ToString()+(char)(y+'A');
    
    			//add new buttons
    			p_socks[x,y]=new Button();
    			this.Controls.Add(p_socks[x,y]);
    			p_socks[x,y].Location = new System.Drawing.Point(10, 10);
    			p_socks[x,y].Name = "butX"+x+"Y"+y;
    			p_socks[x,y].Size = new System.Drawing.Size(20, 20);
    			p_socks[x,y].TabIndex = 20;
    			p_socks[x,y].Click+=new System.EventHandler(sockClickHand);
    			//p_socks[x,y].tooltip????????????????
    		}
    	}
    	this.Refresh();
    	return true;
    }
    thx
    Last edited by Sneeden; Aug 31st, 2005 at 02:49 PM.
    balls deep in bad code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width