|
salman_syed_01 wrote: I want to take picture using my digital camera usig C# application
So your camera provides an interface for doing this? Please provide a link to the documentation.
|
|
|
|
|
If it's a Canon camera, check out my wrapper article for the Canon SDK. If it's not, you can take a picture with most cameras with WMI, but not with the sort of control that Canon offers. Other manufacturers have had SDKs in the past, but none do now, that I know of.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
In a DataGridViewComboColumn I can set a datasource for multiple choices for entring data and the drop down choices show me the display values to select from. The problem is the DataGridView cells, once not in edit mode, show me the actual database data instead of the DisplayMember's value. Is there a simple way to make the column show display values intead of the actual data ?
|
|
|
|
|
Don't answer to such a dum question!
I wasn't paying attention and data types were not matching
Sorry for wasting time
|
|
|
|
|
I need some help. I´m looking for a table with labeled rows and clomuns (like excel).
|
|
|
|
|
hi
this is a good example
http://www.codeproject.com/cs/miscctrl/csharpgridcontrol.asp
regards
|
|
|
|
|
When I run the following code I get the same number 36 times, but when I step through it in debug I get 'random' numbers?!?!
Any idea why?
for (int a = 0; a < 36; a++)<br />
{<br />
Random generator = new Random();<br />
int randomValue;<br />
randomValue = generator.Next(1, 20);<br />
list3.Add(a, randomValue);<br />
}
David Wilkes
|
|
|
|
|
|
Sorry, "list3" is a custom data type similar to a listbox.
David Wilkes
|
|
|
|
|
Hi,
you create a new random generator every time; they each start with a dfeault
seed value, which depends on the current time. As a result, while single stepping
it seems all right; when running it finishes in less than 1 second, so all
seeds are the same.
You should create and use only one generator outside the loop and keep using it.
|
|
|
|
|
Luc Pattyn wrote: you create a new random generator every time;
I totally missed that!
|
|
|
|
|
That makes total sense.
Figured it was something simple.
Thanks!!!
David Wilkes
|
|
|
|
|
Random generator = new Random();
for (int a = 0; a < 36; a++)
{
int randomValue;
randomValue = generator.Next(1, 20);
list3.Add(a, randomValue);
}
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hello all,
I am having 5 combo Boxes in my Form1.cs whose values are not selected.
I have set SelectedIndex = -1.
After this i am opening another form. Doing some operation and closing it.
When the Control returns to Form1.cs all the combo Boxs are having 1st value selected.
I have checked none of the events are getting fired. But by default all the combo boxes are set to SelectedIndex = 0.
Any help regarding this behaviour of ComboBox Values being selected on another form closing would be highly appreciated.
Thanks in Advance.
--Bhoomi
|
|
|
|
|
I am not sure but I think you will have to reset the SelectedIndex agin when the form becomes active. I think it has to do with how forms work ie STA threading model.
|
|
|
|
|
Hi bhoomi
I think you want to select values of combos on first form on the closing of second form....
is it???
Atul
|
|
|
|
|
What is the behaviour of STA Threading Model. Does it fill up 1st values of the attached Datasource on Activate?
Then it is a dangerours thing.
If any user has set out ComboBox to be blank and opens another form then those Blanks goes away. How is the user supposed to know which all values might have changed.
Is there any solution for this??
Any help would be highly appreciated.
Regards,
Bhoomi.
|
|
|
|
|
Hi Bhoomi
I think u want to change the index of combos of first form on closing of second form. If this is question then events and delegates are used int this scenario....
Atul Kumar
|
|
|
|
|
For knowing the exact problem, i have created another application as follows :
1. MDI Form with 2 menus : Form1.cs and Form2.cs
2. Form1.cs
2 Comboboxes filled through DataTable.
3. Form2.cs
Just a TextBox.
Behaviour is like this :
Open Form1.cs in MdiParent. ComboBoxes gets filled up. Remove the selected value manually. Open Form2. Close the Form2. Both the comboBoxes are filled up with 1st values.
I am unable to undertstand why the combo boxes are filled up with initial values on its own.
Any help would be highly appreciated.
Regards,
Bhoomi.
|
|
|
|
|
Not sure why exactely but this is not the only strange behavior I see.
I now that forms run on the STA threading model so a form that doesn't have the control is actually not "running". I think that when a form regains the control, it reinitilizes partly its controls, so behaviors like this are to be expected. I learned with time to be very carefull about this. There must be reading to do on this but I never took the time to do it. try to at least understand the difference between STA and MTA, it will answer many of your questions on forms.
Good luck
|
|
|
|
|
hi i want to get the index valu of the sorted array in some other array
can any 1 help me with this.......?
i need the sorted index to be in another arry....
Array index
0
1
2
3
4
5
6
Values
2
1
7
6
5
4
3
sorted index
2
3
4
5
6
0
1
sorted value
7
6
5
4
3
2
1
Arun Raj.K
|
|
|
|
|
I am trying to build a DataTable from a TList<t>, which is a collection of T business objects. I am using reflection to get all the properties of T, and then loop through them creating DataColumn objects. However, I get an error when I try and create a new column where a property of T is nullable. Is there a quick way around this? Looking at the type name for a nullable property of T is also pretty confusing, as the type name is "Nullable`1".
"A little learning is a dangerous thing; drink deep, or taste not the Pierian spring: there shallow draughts intoxicate the brain, and drinking largely sobers us again.", by Alexander Pope
My New Blog
|
|
|
|
|
You need to get the underlying type, e.g.:
foreach (PropertyInfo propInfo in properties)
{
Type propType = propInfo.PropertyType;
if (propType.IsGenericType &&
propType.GetGenericTypeDefinition() == typeof(Nullable<>))
{
propType = Nullable.GetUnderlyingType(propType);
}
}
|
|
|
|
|
Thanks Lisa, I actually did discover that a while after posting.
I should have updated.
|
|
|
|
|
instead of your
if (propType.IsGenericType &&
propType.GetGenericTypeDefinition() == typeof(Nullable<>))
{
propType = Nullable.GetUnderlyingType(propType);
}
you could also do
column.DataType = Nullable.GetUnderlyingType(PropertyType) ?? PropertyType;
depending on your knowledge about the ?? operator and your preferences it could improve the readability
|
|
|
|