Click here to Skip to main content
15,944,390 members
Home / Discussions / Windows Forms
   

Windows Forms

 
QuestionProblem How to connect from Windows control library To our Database webserver [modified] Pin
emailbhushan26-Mar-09 3:10
emailbhushan26-Mar-09 3:10 
AnswerRe: Problem How to connect from Windows control library To our Database webserver Pin
Dave Kreskowiak27-Mar-09 1:41
mveDave Kreskowiak27-Mar-09 1:41 
Questionseting colors to tabpages in c# Pin
swapna chow26-Mar-09 1:04
swapna chow26-Mar-09 1:04 
AnswerRe: seting colors to tabpages in c# Pin
Henry Minute26-Mar-09 1:35
Henry Minute26-Mar-09 1:35 
QuestionSearching for a report designer tool Pin
Zoltan Aszalos25-Mar-09 22:24
Zoltan Aszalos25-Mar-09 22:24 
AnswerRe: Searching for a report designer tool Pin
Michael Bookatz26-Mar-09 2:47
Michael Bookatz26-Mar-09 2:47 
JokeRe: Searching for a report designer tool Pin
Skymir27-Mar-09 8:21
Skymir27-Mar-09 8:21 
Questionsetting the time while removing the tabpages in c# [modified] Pin
swapna chow24-Mar-09 23:59
swapna chow24-Mar-09 23:59 
Now my given program consists of two buttons ADD and REMOVE with the TabControl.Now the ADD button

to add the tabpages and REMOVE button to remove the tabpages in the order the latestly opened tabpage.That

is,the order of opening(clicking) the tabpages is preserved so,that while removing the tabpage last opened gets

removed first.If u exceute my program below will understand the functionality.

public partial class Form1 : Form
{

private static int pageNumber = 4;
List<tabpage> _cache = new List<tabpage>();

public Form1()
{
InitializeComponent();

this.tabControl1.Selected += new TabControlEventHandler(tabControl1_Selected);

}


void tabControl1_Selected(object sender, TabControlEventArgs e)
{
if (e.TabPage != null)
{
if (_cache.Contains(e.TabPage))
{
_cache.Remove(e.TabPage);




}

_cache.Add(e.TabPage);


}


}



private void button1_Click_1(object sender, EventArgs e)
{

TabPage page = new TabPage("TabPage" + pageNumber.ToString());
tabControl1.TabPages.Add(page);
this.tabControl1.SelectedTab = page;
pageNumber++;


}

private void button2_Click_1(object sender, EventArgs e)
{

if (_cache.Count > 0)
{


this.tabControl1.Selected -= new TabControlEventHandler(tabControl1_Selected);

this.tabControl1.TabPages.Remove(_cache[_cache.Count - 1]);


this.tabControl1.Selected += new TabControlEventHandler(tabControl1_Selected);


_cache.RemoveAt(_cache.Count - 1);

}


if (_cache.Count > 0)
{

this.tabControl1.SelectedTab = _cache[_cache.Count - 1];
}

}

Now,my problem is while removing the tabpages that is,when i click on the REMOVE button after TWO

seconds the tabpages should get removed,that is with the delay of two seconds the tabpage should get removed.That is i need to set the time in the REMOVE Button .Can,u pls help me out unable to fix it can u send me sample according to my program.


Thanks in advance.

modified on Wednesday, March 25, 2009 9:08 AM

AnswerRe: setting the time while removing the tabpages in c# Pin
fly90425-Mar-09 6:08
fly90425-Mar-09 6:08 
GeneralRe: setting the time while removing the tabpages in c# Pin
swapna chow25-Mar-09 19:11
swapna chow25-Mar-09 19:11 
GeneralCreate a border function like excel in datagridview Pin
johnyu199724-Mar-09 22:53
johnyu199724-Mar-09 22:53 
GeneralRe: Create a border function like excel in datagridview Pin
Henry Minute26-Mar-09 1:37
Henry Minute26-Mar-09 1:37 
QuestionTabularReport in c# winforms Pin
avvaru.murali24-Mar-09 7:26
avvaru.murali24-Mar-09 7:26 
Question[Message Deleted] Pin
myms.net24-Mar-09 1:34
myms.net24-Mar-09 1:34 
AnswerRe: property value changed and automatically hide the window Pin
Dave Kreskowiak24-Mar-09 7:45
mveDave Kreskowiak24-Mar-09 7:45 
QuestionAsking About Software Piracy ................... Pin
Isaac Gordon21-Mar-09 0:14
Isaac Gordon21-Mar-09 0:14 
AnswerRe: Asking About Software Piracy ................... Pin
Eddy Vluggen21-Mar-09 0:32
professionalEddy Vluggen21-Mar-09 0:32 
QuestionAsking About Software Piracy ................... Pin
Isaac Gordon21-Mar-09 0:14
Isaac Gordon21-Mar-09 0:14 
QuestionXP Start Menu Pin
MokkNoir19-Mar-09 6:17
MokkNoir19-Mar-09 6:17 
AnswerRe: XP Start Menu Pin
Dave Kreskowiak20-Mar-09 3:04
mveDave Kreskowiak20-Mar-09 3:04 
Questionadd row in datagrid Pin
himani_jha19-Mar-09 2:10
himani_jha19-Mar-09 2:10 
AnswerRe: add row in datagrid Pin
fly90419-Mar-09 2:54
fly90419-Mar-09 2:54 
AnswerRe: add row in datagrid Pin
Michael Bookatz20-Mar-09 2:21
Michael Bookatz20-Mar-09 2:21 
GeneralRe: add row in datagrid Pin
fly90420-Mar-09 14:59
fly90420-Mar-09 14:59 
Questionvisual styles Pin
himani_jha18-Mar-09 22:58
himani_jha18-Mar-09 22:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.