|
how about property of it "Datasource" and "Display Memeber" ? what it use for ? how to use ?
|
|
|
|
|
Hi,
we can set a datatable to datasource.if u want to fill those numbers to combobox we need to loop & then fill datatable & then assign it to combobox.datasource property. Better to use "combobox1.items.add " & a loop .
Display member property is used when we have more no.of columns in a query
for ex: -
<b> SqlCommand cmm = new SqlCommand();
cmm.CommandText = "select Emp_Id,Emp_Name,Emp_Address from Employee";
cmm.CommandType = CommandType.Text;
cn.open();
cmm.Connection = cn;
DataTable dt = new DataTable();
SqlDataAdapter sqldt = new SqlDataAdapter(cmm);
sqldt.Fill(dt);
comboBox1.DataSource = dt;
comboBox1.DisplayMember = "Emp_Name";
comboBox1.ValueMember = "Emp_Id";
cn.close();</b>
While Displaying it Displays employees Name & if u are going to save it in table then we can use
"comboBox1.selectedvalue" property were we get the Emp_Id
|
|
|
|
|
Hi,
i don't think u can have min value & max value for a combo box
Satish Pai B
|
|
|
|
|
i don understand what u mean "min value & max value" ? however i think that in my combo box just store some string values n id. and i want to ask u a bit more... does combo box can store more then 2 colume or fields. for eg: Emp_ID, Emp_Name, Emp_Gender,Emp_Phone.. ?
|
|
|
|
|
No Combo Box can store only 2 columns by 2 Properties
1.DisplayMember - This does the work a displaying a column
2.ValueMember - This does a work what value should be returned when a particular item is choose d.
Ex:-
EmpID EMP_Name
1 abc
2 def
3 xyz
when u select a Emp_name - "def" from combo box & if u use "combobox1.selectedvalue" then it returns 2 or if u select "xyz " then it returns 3
doesn't mind if u still didn't get it.Just reply for doubts.
|
|
|
|
|
does combo box control can show 2 column in its dropdownlist ?
|
|
|
|
|
|
Hi All
I am very new to C#,and i have to set background color of my form, i am trying to do like
Assembly myAssembly = Assembly.GetExecutingAssembly();
Stream testImage= myAssembly.GetManifestResourceStream("Test.jpg");
but here it crashing.
can anybody help me out
thanks in advance
RYK
|
|
|
|
|
Form has BackGroundColor and BackGroundImage property. Use it.
जय हिंद
|
|
|
|
|
?? I don't know what you want, but if you want to change background color of a form, just do like this:
MyForm myForm = new MyForm(); // Here is your form
myForm.BackColor = System.Drawing.Color.Red; // Change the background color to red.
|
|
|
|
|
No No, i want to set a image file
|
|
|
|
|
Use BackGroundImage Property of ur form!(Singl-Click on ur form, then press F4. and use BackGroundImage Property to set an image.
[]D @ []v[] []D @ []v[]
|
|
|
|
|
There is no any option bcakgroungimage that is what i was asking
|
|
|
|
|
no MR.VC_RYK there is a property just arrange the properties in alpahbetical order and just below BackColor the BackgroundImage will be found........search and use it....
Padmanabhan
modified on Friday, May 29, 2009 4:25 AM
|
|
|
|
|
it is impossible...! i check it right now...when u select ur form, from the form properties(F4), Click on BackgroundImage, then use Import... and select ur image with ( *.gif, *.jpg, *.jpeg, *.bmp, *.wmf, *.png ) suffixes.
I hope u see it!
[]D @ []v[] []D @ []v[]
|
|
|
|
|
The BackgroundImage property has been a part of every control since .NET 1.0, so I am sure it exists in yours! Are you sure you have a form, not a console application? Can you open the designer view on it? If so, then check the properties are listed A-Z and that you aren't viewing the events. If really desparate, try using intellisense and check it programatically:
frmMine fm = new frmMine();
fm.BackgroundImage = @"C:\Pic.jpg";
If this comes up with errors, then paste your code here, with the error message.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced.
This message is made of fully recyclable Zeros and Ones
|
|
|
|
|
|
I'm using VS2008 and it's working just fine...
|
|
|
|
|
For Setting the background image of your form
YourFormNAme.BackGroundImage = YOUR-Application-NameSpace.Properties.Resources.YOUR-Resource-Name;
Ahsan Ullah
Senior Software Engineer
MCTS 2.0
|
|
|
|
|
Hi All,
I am using Visual Studio 2005, .Net 2.0. In my application, i am using more number of Designer Host instances, So when i am using more than 36 instances of Designer Host, i cant able to resize the controls. If the number of instances of Designer Host is less than equal to 36 , then it is working fine.
Below is the link of an example given by the microsoft. It is also giving the same problem when adding more than 36 forms(i.e. Designer Host Form).
http://msdn.microsoft.com/en-us/magazine/cc163634.aspx
Can anyone please give me a solution.
Thanks & Regards,
Vaira Muthu.
|
|
|
|
|
We are working on a .net application that would require to update the inventory tables of Peoplesoft database. What is the best way to do this, i.e, to update the inventory tables of Peoplesoft by an external application?
|
|
|
|
|
You asked it twice yesterday and you've started asking it again today. The question is, what does it have to do with C#?! Even though your application is on .NET, your query has something to do with some third party stuff.
You will need to read the Peoplesoft API manual and/or go and ask it in one of their forums. There is no point in reposting this stuff every day here.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Dear Friends,
I need a Regular Expression for validate a text box which allows 0 to 1000 in C# Windows applications...
|
|
|
|
|
Sounds trivial to me. What have you done so far ?
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
Lol you made me smile this morning!
|
|
|
|