|
I believe you can do:
myGroupBox.Enabled = false; and it will disable everything inside the groupbox.
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
Just for fun I'd like to be able to get an interface with a pc cam or a digital camera hooked up through usb. Like, for example I could write an app that does time-lapse photography on my cactus (which does move, btw), or claymation maybe. Like, I could save one frame every 10 minutes. Or of course for doing webcams..
I know there's software that comes with some pc cams that does some of that already, but, being a programmer, I'd like to get my hooks into it myself. Does directx do this, maybe? I'm worried that each cam will be non-standard about it's protocol, etc... anyone know?
thanks
"Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read."
-Groucho Marx
|
|
|
|
|
I recently found out that you can actually declare a class within a class, like so:
public class Class1
{
public class Class2
{
....
}
}
My question is, why would you ever want to that, as opposed to declaring the class separately like so:
public class Class2
{
}
public class Class1
{
Class2 cls;
}
Is there some hidden advantage to doing it the former way that I'm not aware of?
|
|
|
|
|
With this approach, you can create a Private Class (SubType)
Only the outter class can have access to the inner class
Free your mind...
|
|
|
|
|
Guillermo Rivero wrote:
Only the outter class can have access to the inner class
That is not true. This works:
public class MyDataSet
{
public class MyDataRow
{
}
}
public class MyApp
{
MyDataRow row = new MyDataRow();
}
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
You are right. sorry...
Free your mind...
|
|
|
|
|
I meant, if you have a private class inside a public class, the inner class is only visible within the scope of the public class...
Free your mind...
|
|
|
|
|
In addition to the previous answer:
~ The nested class has access to the containing classes private members.
~ Nested classes are commonly declared public and used as the type of properties or the return value of methods on the enclosing type. An enumerator is the canonical example of this. This avoids poluting the public namespace.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
|
Blake Coverett wrote:
An enumerator is the canonical example of this. This avoids poluting the public namespace.
Ummm...everywhere in the .NET Framework, enums are part of the namespace and not the class. So that's not really a canonical example...or even an example.
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
Umm... sorry, no.
The enumerator interfaces are in the collection namespace but the actual types returned are:
ArrayList.GetEnumerator() => ArrayList.ArrayListEnumeratorSimple
ArrayList.GetEnumerator(int, int) => ArrayList.ArrayListEnumerator
Hashtable.GetEnumerator() => Hashtable.HashtableEnumerator
Hashtable.Keys.GetEnumerator() => Hashtable.HashtableEnumerator
Hashtable.Values.GetEnumerator() => Hashtable.HashtableEnumerator
... and the same for all the rest.
Hmm... as I get to the end of this I just realize you may have read it wrong. Enumerators are the canonical example. Were you thinking about Enumerations?
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Blake Coverett wrote:
Enumerators are the canonical example. Were you thinking about Enumerations?
Sorry bout that.
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
Hmmm...you can see my replies to the other two...but the most common place I've seen this is in the Windows Forms part of the framework. For instance, a ListView has several collection classes defined within it:
ListView.CheckedIndexCollection
ListView.CheckedListViewItemCollection
ListView.ColumnHeaderCollection
ListView.SelectedIndexCollection
ListView.SelectedListViewItemCollection
etc.
And that's the only place I would consider using it. Or for instance, Deklarit creates specialized DataSets with the DataRows and DataTables within the DataSet class itself:
public class MyDataSet
{
public class MyDataRow{}
public class MyDataTable{}
}
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
I'm beginning to get a clearer picture. Thanks.
|
|
|
|
|
Hey,
I have to explain my problem with an example.
I have a lot of codes to use in my application ex. sexe : man/woman; language: English/French/...
Let say sexe : man and woman are the descriptions of the code 1 and 2. These codes are in my database.
Do I make a class sexe and how?
Because in my application I have an object person and that person have a sexe.
I will program like follows :
if (person.sexe.man)
{..some code..}
and not like I am doing now
if (person.sexe = 1)
{..here some code to treath the person as a man...}
This is not very readable.
So, my question is what do I have to do with the object sexe (how will I build it) and how I use it in my person object.
thanks in advance
bene
|
|
|
|
|
If I understand what you are asking for I think you could solve it without making the sexe a custom object. Make sexe an "int" and then add this:
public class humanSex
{
public const int Male = 1;
public const int Female = 2;
}
You then would reference it to something like:
if (person.sexe == humanSex.Male)
|
|
|
|
|
Or better yet, because an enum's underlying type is an int, he could do this:
public Enum Sex
{
Male = 1,
Female = 2
}
and then check with the same thing as you have above.
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
|
Okay okay...you win.
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
I'm designing an application in C# and I want UI a bit more exciting than the standard windows effort.(Think winamp or mediaplayer skins)
What is the best way to go about this?
Using a standard Forms.Form and and try and intercept Non client Draw commands?
Or start from the ground up inhieiting from something above form?
Help Appreciated
Conor
|
|
|
|
|
You can buy a GUI package like SharpLibrary, you can do owner-drawing yourself (alot of work), or you can wait a few months for Fluid to come out (see sig).
There are also some good skinnable controls on CP, but precious few now that Carlos Perez took his controls off.
|
|
|
|
|
jdunlap wrote:
or you can wait a few months for Fluid to come out
Have you guys actually started any work on this yet? Or is it just a bunch of flashy HTML pages and diagrams?
I'm just kidding, I'd just like to know where you guys are on the timeline.
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
David Stone wrote:
Have you guys actually started any work on this yet? Or is it just a bunch of flashy HTML pages and diagrams?
About 10,000* lines of code and growing. We'll release some basic controls in 1 1/2 - 2 months (probably 2).
[EDIT] * 8000 lines for C#, 2000 for C++. We are behind on C++ because of troubles w/ our dictionary and collection classes. [/EDIT]
|
|
|
|
|
jdunlap wrote:
About 10,000* lines of code and growing
Wow.
jdunlap wrote:
We'll release some basic controls in 1 1/2 - 2 months (probably 2).
Sounds like fun. I'm looking forward to it. I looked over your diagrams a few weeks ago and they look great...very .NET-ish.
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
Let me toss in a vote for 'Just Say No'. The whole craze for skinnable applications is a bad bad thing from a user interface design/human factors perspective. It's a throwback to the days of DOS when ever application had a unique UI and everyone had to learn how to work the 'exciting' widgets and controls that application came up with.
I know it's all the rage, but please, think of the users and resist.
Just my ever humble opinion, of course....
--
-Blake (com/bcdev/blake)
|
|
|
|