473,657 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recognising a Tab click

Hey folks,

I'm new to this malarky, but I can't find anywhere an example of
programmaticall y 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(o bject sender, System.EventArg s e)

{
if (this.tabContro l1.SelectedInde x = 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.

Nov 13 '05 #1
3 4396
Hi

ferg wrote:
Hey folks,

I'm new to this malarky, but I can't find anywhere an example of
programmaticall y 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(o bject sender, System.EventArg s e)

{

// if (this.tabContro l1.SelectedInde x = 0)

// try this:

if (this.tabContro l1.SelectedInde x == 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

Nov 13 '05 #2
The following syntax is wrong.
if (this.tabContro l1.SelectedInde x = 0)
should be
if (this.tabContro l1.SelectedInde x == 0)

Thanks
-----Original Message-----
Hey folks,

I'm new to this malarky, but I can't find anywhere an example ofprogrammatical ly 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(o bject sender, System.EventArg s e)
{
if (this.tabContro l1.SelectedInde x = 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.

.

Nov 13 '05 #3
I feel like a real dumbass now. Thanks guys. :-)
"buddy" <bu***@onlinewo rk.com> wrote in message
news:0e******** *************** *****@phx.gbl.. .
The following syntax is wrong.
if (this.tabContro l1.SelectedInde x = 0)


should be
if (this.tabContro l1.SelectedInde x == 0)

Thanks
-----Original Message-----
Hey folks,

I'm new to this malarky, but I can't find anywhere an

example of
programmatical ly 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(o bject sender,

System.EventArg s e)

{
if (this.tabContro l1.SelectedInde x = 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.

.

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
17247
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 do myDomElement.click and the mouse doesn't matter, but in the case of an input image element, what happens is the submitted url has something like "?x=12&y=7" appended to it (the numbers vary per mouse position on the clicked element). If you hit...
1
4185
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 continue the execution code on a other button or anything else. Example 1) Click anywhere intercept click->Execute the code in function click().
7
15491
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. The code as it stands does not work in Firefox, and I suspect that the task of feature detection (which currently depends on browser detection) can be carried out better. The result should be that opcode is set to 0,1 or 2 dor click,...
11
535
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 user entered a Left Click or a Double Click?
5
6166
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 Click event to the ImageButton Column and it makes no difference, I still get a postback. This is driving me crazy...something seems to be causing an OnClick postback and it isn't my Click event I've included the code below....any help will be...
41
4288
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 on some initialization information obtained elsewhere. Basically, I'm going to create my own dynamic toolbar where the toolbarbuttons can change. I'm not using the VB toolbar because of limitations in changing things like backcolor (I can't get...
12
2577
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 than one line and the text simply overlaps the sub-menus below it. I thought i had got around this by placing empty 'spacers' like so; oFoldMenu.make('sub3','')//spacer unfortunately, i have just viewed the site in IExplorer and it has added...
2
3424
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 page, then save action will call) this should not be happen. only data will save , when we click on the save button. Why every refresh save action getting call and what is solution on this problem? Is there any javascript method available to...
0
8421
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8742
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8518
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5643
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1971
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.