|
mycombo.Items.Add("SomeText");
and just doubleclick the button in your designer.
Hope this helps.
|
|
|
|
|
Have a look at Link Buttons. If the list of names is done on the fly add a unique ID to each LinkButton. This should help if i have got the idea of what you are asking
LinkButton yourButtonName = new LinkButton();
yourButtonName.Command +=new CommandEventHandler(yourButtonName_Click);
private void yourButtonName_Click(object sender, CommandEventArgs e)
{
}
tlab
|
|
|
|
|
I think you might want to reply this to Phillip Hodges who is in need of this answer :->.
|
|
|
|
|
Sorry my bad, Is that my brain sleeping? I think it is!
|
|
|
|
|
Have a look at Link Buttons. If the list of names is done on the fly add a unique ID to each LinkButton. This should help if i have got the idea of what you are asking
LinkButton yourButtonName = new LinkButton();
yourButtonName.Command +=new CommandEventHandler(yourButtonName_Click);
private void yourButtonName_Click(object sender, CommandEventArgs e)
{
}
tlab
tlab
|
|
|
|
|
Dear all,
If for example I am trying to make a custom folder explorer (to display PSP film names correctly) and I am using a TreeView to display the folder hierachy.
Is it possible to access the system icons for example the currently used Folder icon from the Shell to use??
Many thanks
Paul
ps VS2005 and C#
|
|
|
|
|
for getting file icons you need to use shell APIs. you can use the following snippet.
[StructLayout(LayoutKind.Sequential)]
public struct SHFILEINFO
{
public IntPtr hIcon;
public IntPtr iIcon;
public uint dwAttributes;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string szDisplayName;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)]
public string szTypeName;
};
class Win32
{
public const uint SHGFI_ICON = 0x100;
public const uint SHGFI_LARGEICON = 0x0;
public const uint SHGFI_SMALLICON = 0x1;
[DllImport("shell32.dll")]
public static extern IntPtr SHGetFileInfo(string pszPath, uint dwFileAttributes, ref SHFILEINFO psfi, uint cbSizeFileInfo, uint uFlags);
}
IntPtr hImgSmall;
string fName = "c:\\getfileicon.cs";
SHFILEINFO shinfo = new SHFILEINFO();
hImgSmall = Win32.SHGetFileInfo(fName, 0, ref shinfo,(uint)Marshal.SizeOf(shinfo),Win32.SHGFI_ICON |Win32.SHGFI_SMALLICON);
System.Drawing.Icon myIcon = System.Drawing.Icon.FromHandle(shinfo.hIcon);
imageList1.Images.Add(myIcon);
I think this code would be helpful.
Saqib
|
|
|
|
|
|
Hi,
Can anyone help me to change the display name of a property outside the class (ie)in some other class with or without the help of attribute.
Thank you,
regards
Praveen
|
|
|
|
|
Can you elaborate your question in detail.
|
|
|
|
|
hi,
Sorry for the delay , this is my question how can i changethe display name of a property outside the class , as of now i can change the name using attributes but those are done in same class as the property lies.
eg.
class a
{
[displayname("hello")]
property 1{ get{;} set{;}}
}
this is how iam changing it now
but i need to change the display name in some other class (eg) in class
"b" how can i do it.
Thank you,
Regards
praveen.
|
|
|
|
|
Dear all,
i have developed a multilingual application using C#.NET in VS.NET 2003.
Here i am using the resource files to get the required data based on the selected Culture.
The display details are perfect for labels, buttons, richtext boxes etc...
But, in the text boxes, messages boxes, Display name of the form & menu names only squares are displayed for some special characters based on the selected culture.
Did anyone face the same problem. Kindly guide me to achieve the same so that i can display the details based on the selected languages/cultures in all the controls
Best regards,
Abhilash
|
|
|
|
|
Probably font of textbox and messagebox dont support unicode. Have you checked that out?
|
|
|
|
|
thanks for ur suggestion..
but how to check it? & is it possible to make textbox, messagebox & menu items to support unicode?
a per my observation, they are acting as notepad. not supporting rich text.
i copied the same special chaacters in txt & rtf files. In rtf file, the characters are displayed pefectly. But, in txt file, they are displayed as squares, same as in textbox, messagebox & menu items.
|
|
|
|
|
Cope the text into Notepad - find a font that does display them. Obviously I assume you HAVE installed asian/script font support - and rebootet the system. People tend to skip the reboot because for exampel IE does not seem to need it - but WinFrom applications requires it.
Once you have a font name, try setting that on your controls (it really should not be needed on the messagebox (nor is there an easy way to do it), unless someone has overridded the default font setup to a font without support.
|
|
|
|
|
Are there a way how you can combine two data columns in a listbox
in Asp.net and set the background color for the main column,
for example the two columns are Town and Suburb, I am trying to combine
them with the main Column "Town" and then his Suburbs and then the second Town and then his Suburbs like the following
Town1
Suburb1
Suburb2
Suburb3
Town2
Suburb1
Suburb2
Suburb3
Town3
Suburb1
Suburb2
Suburb3
Please help I went through a few Sql books already.
Samuel G
|
|
|
|
|
Hello!
I´ve got a problem with users losing the ability to view controls when their video resolution settings are set to a low resolution. The program is optimized for 1024*768, and when a user has for an example 800*600, some controls disappear. I´ve tried with making scrollbars appear in a situation like this with the property autoscroll set to true, but it doesn´t help. Anyone got a suggestion what I should do?
/Regards
|
|
|
|
|
let the users change for 1024*768
|
|
|
|
|
your form's height and width should not more than 800x600
|
|
|
|
|
Yes that is one solution, but as I said the application is optimized for 1024*768, which also 99% of users will have. I´d prefer a solution with scrollbars appearing. I´m currently experimenting with autoscrollminsize property.
|
|
|
|
|
u got the answer below, Anchor and docking
|
|
|
|
|
There is a concept of Docking controls in windows applications in C#. Whenever I make an application I never set its width or hard code any of such attributes. All I do is to dock all the controls in such a way that the controls adjust themselves whatever the resolution is. Then you always set their minimum and maximum properties so that the controls dont get too much distorted on different resolutions or on resizing.
Hope it helps.
Regards
Khalid
|
|
|
|
|
Try Anchor and Dock properties... They are your life saver;)
|
|
|
|
|
|
There is an built-in types table for .NET framework type to C# type which are
aliases of predefined types in the System namespace
(http://msdn2.microsoft.com/en-US/library/ya5y69ds.aspx).
How can use access and use this table (by C# code) to convert the alias to
the .NET framework type.
For example: if I have:
string aliasType = "int";
string frameworkType = ???
-------
Thanks
Sharon
|
|
|
|