Hey folks,
I'm new to this malarky, but I can't find anywhere an example of
programmatically recognising which tab a user has clicked.
I know it's something to do with the SelectedIndex property of the tab
object, but I can't get it into an "if" statement without it complaining.
Here's what I have...
private void fclsTabs_Load(object sender, System.EventArgs e)
{
if (this.tabControl1.SelectedIndex = 0)
txtTextBoxMain.Text = "Tab 1";
}
This complains with "Cannot implicitly convert type 'int' to 'bool' (whether
I have the "this" word in or not).
Can someone tell me what I'm doing wrong?
Thanks,
Ferg. 3 4382
Hi
ferg wrote: Hey folks,
I'm new to this malarky, but I can't find anywhere an example of programmatically recognising which tab a user has clicked. I know it's something to do with the SelectedIndex property of the tab object, but I can't get it into an "if" statement without it complaining.
Here's what I have...
private void fclsTabs_Load(object sender, System.EventArgs e)
{
// if (this.tabControl1.SelectedIndex = 0)
// try this:
if (this.tabControl1.SelectedIndex == 0) txtTextBoxMain.Text = "Tab 1";
}
This complains with "Cannot implicitly convert type 'int' to 'bool' (whether I have the "this" word in or not).
Can someone tell me what I'm doing wrong?
In c# (like in c, c++, java) "is equal" operator is "==" (not "=")
Marcin Grzêbski
The following syntax is wrong. if (this.tabControl1.SelectedIndex = 0)
should be
if (this.tabControl1.SelectedIndex == 0)
Thanks
-----Original Message----- Hey folks,
I'm new to this malarky, but I can't find anywhere an
example ofprogrammatically recognising which tab a user has clicked. I know it's something to do with the SelectedIndex
property of the tabobject, but I can't get it into an "if" statement without
it complaining. Here's what I have...
private void fclsTabs_Load(object sender,
System.EventArgs e) {
if (this.tabControl1.SelectedIndex = 0)
txtTextBoxMain.Text = "Tab 1";
}
This complains with "Cannot implicitly convert type 'int'
to 'bool' (whetherI have the "this" word in or not).
Can someone tell me what I'm doing wrong?
Thanks,
Ferg. .
I feel like a real dumbass now. Thanks guys. :-)
"buddy" <bu***@onlinework.com> wrote in message
news:0e****************************@phx.gbl... The following syntax is wrong.
if (this.tabControl1.SelectedIndex = 0)
should be if (this.tabControl1.SelectedIndex == 0)
Thanks
-----Original Message----- Hey folks,
I'm new to this malarky, but I can't find anywhere an example ofprogrammatically recognising which tab a user has clicked. I know it's something to do with the SelectedIndex property of the tabobject, but I can't get it into an "if" statement without it complaining. Here's what I have...
private void fclsTabs_Load(object sender,
System.EventArgs e) {
if (this.tabControl1.SelectedIndex = 0)
txtTextBoxMain.Text = "Tab 1";
}
This complains with "Cannot implicitly convert type 'int'
to 'bool' (whetherI have the "this" word in or not).
Can someone tell me what I'm doing wrong?
Thanks,
Ferg. . This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Csaba2000 |
last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE
5.5+). This should work regardless of whether IE has focus. Normally you would...
|
by: zoltix |
last post by:
Hi,
I am beginner in JavaScript. I would like to intercept all click
events on my document. I use this function for that
document.onmousedown=click;. It works well. But I would like to...
|
by: Paul Cooper |
last post by:
Dear All,
I am working on a piece of Javascript code that needs to detect a
mouse-click, shift-click and control-click. The code is not my own -
it is a part of a much larger suite of routines....
|
by: Thom Little |
last post by:
I would like three states on an icon ...
Left Click
Right Click
Double Click
Left Click is fired at least once on a Double Click
Is there a good example that shows how to determine if the...
|
by: J McD |
last post by:
Hi
I have a DataGrid with an ImageButton column. When I click on an imagebutton I get a postback but it doesn't run the OnImgBtnClick method. I can actually comment out the line where I add this...
|
by: JohnR |
last post by:
In it's simplest form, assume that I have created a usercontrol,
WSToolBarButton that contains a button. I would like to eventually create
copies of WSToolBarButton dynamically at run time based...
|
by: tim |
last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus
in firefox. On my sub3 menus i have more than one line of text in some
places. firefox does not recognise that there is more...
|
by: pingalkar |
last post by:
In my application, on one form i m getting information from user and save this information , after saving this information again we loading that page. (At this moment if any one try to refresh this...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |