473,503 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing If syntax from VB to C#

I searched hard for some advanced c# combobox code and couldn't find any. I
found some examples in vb.net and I am trying to work the new features into
c#. I am having difficulty with converting a few things, I will start with
an If statement.

In vb the line looks like this:
If _showColumns AndAlso (ea.State And
DrawItemState.ComboBoxEdit) <> DrawItemState.ComboBoxEdit Then

in this example:
_showColumns is bool
ea.State is Forms.DrawItemState

What does this vb logic do and how can I accomplish the same thing in c#?

Thanks,
Nathan
Nov 16 '05 #1
1 1296
Nathan,

You would do this:

if (_showColumns && (ea.State & DrawItemState.ComboBoxEdit !=
DrawItemState.ComboBoxEdit))
{
// Do something here.
}

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Nathan Kovac" <na**@tctelco.net> wrote in message
news:e2**************@TK2MSFTNGP12.phx.gbl...
I searched hard for some advanced c# combobox code and couldn't find any.
I
found some examples in vb.net and I am trying to work the new features
into
c#. I am having difficulty with converting a few things, I will start with
an If statement.

In vb the line looks like this:
If _showColumns AndAlso (ea.State And
DrawItemState.ComboBoxEdit) <> DrawItemState.ComboBoxEdit Then

in this example:
_showColumns is bool
ea.State is Forms.DrawItemState

What does this vb logic do and how can I accomplish the same thing in c#?

Thanks,
Nathan

Nov 16 '05 #2

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

Similar topics

12
1612
by: Eli Daniel | last post by:
Hi, I'm new to Python. Can you please tell me if the following is possible. My users are using other scripting launguage to write scripts. They are used to write somthing like (keeping it...
31
2652
by: Bo Peng | last post by:
Dear list, I have many dictionaries with the same set of keys and I would like to write a function to calculate something based on these values. For example, I have a = {'x':1, 'y':2} b =...
1
3420
by: Kelly Prendergast | last post by:
Hi there, We have a user name convention here that specifies users in the following way: jane.doe john.smith In order to change a database object I must specify the owner name along with the...
3
1971
by: Billy | last post by:
Hello, I'm having a problem dynamically changing the color of a table background. I'm not sure exactly how to word this, but I'll give an example. I have a function called greentored(propname)...
31
5659
by: Arthur Shapiro | last post by:
I'm the webmaster for a recreational organization. As part of one page of the site, I have an HTML "Calendar at a Glance" of the organization's events for the month. It's a simple table of a...
1
1289
by: Samridhi Kumar Shukla | last post by:
I am facing technical difficulti in using server connection control because we cannot change the path once fixed .. one way is to edit the code of the form generated code but though it allow to...
1
2221
by: Geoff Jones | last post by:
Hi Is it possible to change the type of data a column holds in DataTable at runtime? For example, suppose that the table column originally holds Strings, can we, at runtime, change it to...
8
3897
by: Bosconian | last post by:
I have two multiple select inputs. Initially the first contains a bunch of items and the second is empty. Using a common method, I move items back and forth by double clicking on them. This...
5
2159
by: sparks | last post by:
We have a database with 1600+ records in it. They are linked across 7 tables by an ID type autonumber. Now we want(not I want LOL) to remove the first 1200 records no problem but they also...
10
45137
by: steve | last post by:
Hi All I would like to be able to change the cell borders on certain cells to none at runtime to make a group of cells appear to be merged I have tried the following in the cellformatting...
0
7203
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,...
0
7087
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...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
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...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4675
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...
0
1514
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 ...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.