473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Here is what I really need from SelectedIndex...

Ok,
I populate the combobox just once upon page "initializecomponent":

PaperSource pkSource;
for (int i = 0; i < printDoc.PrinterSettings.PaperSources.Count;
i++)
{
pkSource = printDoc.PrinterSettings.PaperSources[i];
comboBox1.Items.Add(pkSource);
}
Now, I want to programatically select the index value without clicking
on it, because, I know the value! Can I do this?:

PrintDocument printDoc = new PrintDocument();

printDoc.DefaultPageSettings.PaperSource =
printDoc.PrinterSettings.PaperSources[comboBox1.SelectedIndex =
4]; <<<I know it needs to be 4 without selecting it.
Thanks,
Trint

Nov 16 '05 #1
1 1048
This worked! This is correct code.
Thanks,
Trint

Nov 16 '05 #2

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

Similar topics

7
by: Keyed4U | last post by:
I have a drop down list system (works to some extent) for a date range search that I need to do a little more. The following is a small sample from the script: function modify_mo_list(mo_model)...
7
by: Fendi Baba | last post by:
The function is called from opencalendar(targetfield). Thanks for any hints on what could be the problem. .............................................................. var...
1
by: Tom | last post by:
Hi There are a Checkboxlist with 20 checkboxitems and a string "1,3,5,7,9,11,13,15,17,20" which are those selectedindex of the checkboxlist. I used a foreach looping to record those selectedindex...
2
by: MrSmoofy | last post by:
Ok I'll start out with I found: http://support.microsoft.com/kb/327244/ BUG: ComboBox Does Not Clear When You Set SelectedIndex to -1 Ok so in HTML you can have: <select id="MyList">...
7
by: Brian Henry | last post by:
I have a list box bound to a data set, of course the datasource,datamember, and valuemember are set, i tell it selecteditem = -1 to make nothing selected, select mode is set to only one item at a...
12
by: Steve Dyte | last post by:
Hi, I've narrowed down a problem I've been having filling a combobox with the results of a query stored in a datatable. I'm setting the ValueMember and DisplayMember to the relevant column...
4
by: brian | last post by:
i broke down where i think the problems areas would be. any help would be greatly appreciated. where the file is called <script type="text/javascript" src="k.js"> </script> the beginning...
2
by: =?Utf-8?B?YW5kcnl1aGE=?= | last post by:
I have a listbox and auto generated lb_SelectedIndexChanged event that handles lb.SelectedIndexChanged. The event obviously fires when I change the selectedIndex visually with a mouse and also...
2
by: dibblm | last post by:
I'll start this hopefully simple and add code where needed or requested. Im using a combobox that bound to a DataSet. The Dataset retreives it's values from SQL. I can retreive the values...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.