Click here to Skip to main content
15,899,825 members
Home / Discussions / C#
   

C#

 
GeneralC# UserControl in a Win32 Window Pin
dirkhelmet!@yahoo.com22-Jul-05 7:01
dirkhelmet!@yahoo.com22-Jul-05 7:01 
GeneralRe: C# UserControl in a Win32 Window Pin
Alomgir Miah22-Jul-05 7:39
Alomgir Miah22-Jul-05 7:39 
GeneralProblems Reading Cell Values from Excel Spreadsheets Using OleDB Pin
fmarcos22-Jul-05 6:55
fmarcos22-Jul-05 6:55 
GeneralRe: Problems Reading Cell Values from Excel Spreadsheets Using OleDB Pin
fmarcos22-Jul-05 7:18
fmarcos22-Jul-05 7:18 
Generalwriting to ms word document bookmarks Pin
xrado22-Jul-05 6:33
xrado22-Jul-05 6:33 
GeneralRe: writing to ms word document bookmarks Pin
Alomgir Miah22-Jul-05 7:50
Alomgir Miah22-Jul-05 7:50 
GeneralRe: writing to ms word document bookmarks Pin
sameerhanda25-Jul-05 17:15
sameerhanda25-Jul-05 17:15 
GeneralCombobox.DisplayName and Interfaces Pin
Miszou22-Jul-05 6:21
Miszou22-Jul-05 6:21 
I have a combobox that displays a list of dynamically loaded "plugin" objects, using the code below:

// Load the assembly.<br />
Assembly ControlLib = Assembly.LoadFrom( Location );<br />
<br />
// Create the plugin.<br />
object objPlugin = ControlLib.CreateInstance( ControlName );<br />
<br />
// Add the plugin to the combo box<br />
cboList.Items.Add( (IFTPlugin)objPlugin );


I have set the combobox "DisplayName" property to "Caption" (a member of the IFTPlugin interface), but it always calls ToString on the object instead and shows the assembly name instead of the friendly name.

I know that the object is loaded correctly, and that the "Caption" method is working, because I can call the following code and get the expected result:

string strCaption = ((IFTPlugin)objPlugin).Caption;

Rather than override the objects ToString function, is there a way to get the combobox to correctly call IFTPlugin.Caption ?

Thanks for your help.




The StartPage Randomizer

GeneralRe: Combobox.DisplayName and Interfaces Pin
malharone22-Jul-05 6:41
malharone22-Jul-05 6:41 
GeneralRe: Combobox.DisplayName and Interfaces Pin
Alomgir Miah22-Jul-05 7:42
Alomgir Miah22-Jul-05 7:42 
GeneralRe: Combobox.DisplayName and Interfaces Pin
leppie22-Jul-05 11:27
leppie22-Jul-05 11:27 
GeneralRe: Combobox.DisplayName and Interfaces Pin
Miszou22-Jul-05 17:06
Miszou22-Jul-05 17:06 
QuestionApplication Manifest Bug C#? Pin
rkap22-Jul-05 5:49
rkap22-Jul-05 5:49 
GeneralExplorer in C# Pin
Fco. Javier Marin22-Jul-05 5:41
Fco. Javier Marin22-Jul-05 5:41 
GeneralDrawing a line Pin
zaboboa22-Jul-05 5:41
zaboboa22-Jul-05 5:41 
GeneralRe: Drawing a line Pin
K-Nine22-Jul-05 6:13
K-Nine22-Jul-05 6:13 
GeneralRe: Drawing a line Pin
zaboboa22-Jul-05 6:23
zaboboa22-Jul-05 6:23 
GeneralAdd forms to a container Pin
David_cole22-Jul-05 5:36
David_cole22-Jul-05 5:36 
GeneralRe: Add forms to a container Pin
Dave Kreskowiak22-Jul-05 5:50
mveDave Kreskowiak22-Jul-05 5:50 
GeneralRe: Add forms to a container Pin
David_cole22-Jul-05 5:59
David_cole22-Jul-05 5:59 
GeneralRemoting disconnections Pin
Judah Gabriel Himango22-Jul-05 5:26
sponsorJudah Gabriel Himango22-Jul-05 5:26 
GeneralRe: Remoting disconnections Pin
mav.northwind23-Jul-05 0:26
mav.northwind23-Jul-05 0:26 
GeneralReport Generator Pin
Akbar Qofrani22-Jul-05 5:16
Akbar Qofrani22-Jul-05 5:16 
GeneralRe: Report Generator Pin
Anonymous24-Jul-05 21:00
Anonymous24-Jul-05 21:00 
GeneralRe: Report Generator Pin
Anonymous25-Jul-05 23:08
Anonymous25-Jul-05 23:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.