Click here to Skip to main content
15,901,284 members
Home / Discussions / C#
   

C#

 
SuggestionRe: C# Find and Replace Pin
Nevin Janzen23-Nov-11 7:30
Nevin Janzen23-Nov-11 7:30 
AnswerRe: C# Find and Replace Pin
BillWoodruff24-Nov-11 7:24
professionalBillWoodruff24-Nov-11 7:24 
QuestionHow to control Cell Value in DatagridView ... Pin
nassimnastaran23-Nov-11 5:25
nassimnastaran23-Nov-11 5:25 
AnswerRe: How to control Cell Value in DatagridView ... Pin
Dan Mos23-Nov-11 5:30
Dan Mos23-Nov-11 5:30 
GeneralRe: How to control Cell Value in DatagridView ... Pin
nassimnastaran23-Nov-11 6:31
nassimnastaran23-Nov-11 6:31 
AnswerRe: How to control Cell Value in DatagridView ...[modified] Pin
Dan Mos23-Nov-11 6:41
Dan Mos23-Nov-11 6:41 
GeneralRe: How to control Cell Value in DatagridView ... Pin
nassimnastaran23-Nov-11 6:46
nassimnastaran23-Nov-11 6:46 
AnswerRe: How to control Cell Value in DatagridView ... Pin
Dan Mos23-Nov-11 7:17
Dan Mos23-Nov-11 7:17 
First, don't add/remove tabs. An easier way is to just activate the needed one.
If you must, you could set the Visible property to false;
C#
bool error=false;

for (int i = 0; i < 3; i++)
{
        for (int j = 0; j < 4; j++)
    {
        if (DataGridView1[i, j].Value == null || DataGridView1[i, j].Value.Equals(""))
        {
           error=true;
           break;
        }
    } 
}

if(error){
MessageBox.Show("something");
tabControl1.SelectTab("tabPage1");
}
else{ tabControl1.SelectTab("tabPage2");}


Note that SelectTab() also supports a int as a parameter, e.g. TabCtrl.SelectTab(0);
All the best,

Dan


modified 23-Nov-11 13:44pm.

GeneralRe: How to control Cell Value in DatagridView ... Pin
nassimnastaran23-Nov-11 7:40
nassimnastaran23-Nov-11 7:40 
Questiona hypothetical about use of custom Attributes in C# in WinForms Pin
BillWoodruff23-Nov-11 1:07
professionalBillWoodruff23-Nov-11 1:07 
AnswerRe: a hypothetical about use of custom Attributes in C# in WinForms Pin
Pete O'Hanlon23-Nov-11 1:15
mvePete O'Hanlon23-Nov-11 1:15 
AnswerRe: a hypothetical about use of custom Attributes in C# in WinForms Pin
BobJanova23-Nov-11 6:27
BobJanova23-Nov-11 6:27 
QuestionAttempted to read or write protected memory. This is often an indication that other memory is corrupt. Pin
Paulraj G22-Nov-11 21:55
Paulraj G22-Nov-11 21:55 
AnswerRe: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Pin
BobJanova22-Nov-11 22:35
BobJanova22-Nov-11 22:35 
AnswerRe: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Pin
Richard MacCutchan23-Nov-11 0:09
mveRichard MacCutchan23-Nov-11 0:09 
AnswerRe: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Pin
Bernhard Hiller23-Nov-11 2:51
Bernhard Hiller23-Nov-11 2:51 
QuestionHighlight Character Pin
phani.sv22-Nov-11 20:19
phani.sv22-Nov-11 20:19 
AnswerRe: Highlight Character Pin
V.22-Nov-11 20:56
professionalV.22-Nov-11 20:56 
GeneralRe: Highlight Character Pin
Nevin Janzen23-Nov-11 3:59
Nevin Janzen23-Nov-11 3:59 
GeneralRe: Highlight Character Pin
phani.sv23-Nov-11 17:37
phani.sv23-Nov-11 17:37 
GeneralRe: Highlight Character Pin
V.23-Nov-11 20:29
professionalV.23-Nov-11 20:29 
QuestionC# 5.0 Pin
Nevin Janzen22-Nov-11 17:35
Nevin Janzen22-Nov-11 17:35 
AnswerRe: C# 5.0 Pin
Dan Mos22-Nov-11 20:46
Dan Mos22-Nov-11 20:46 
GeneralRe: C# 5.0 Pin
Nevin Janzen23-Nov-11 3:56
Nevin Janzen23-Nov-11 3:56 
AnswerRe: C# 5.0 Pin
emardini27-Nov-11 16:49
emardini27-Nov-11 16:49 

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.