|
The only thing I might add to make this answer a bit more plain to understand is that Interfaces are often referred to as "contracts." That is, they represent an obligation of the implementing class to support whatever is declared in the interface. However, by no means are interfaces to restrict the implementing class to only what is promised in the interface.
|
|
|
|
|
How can I control the order that my properties appear in the DataBindings BindingSource selection dialog? Sorted alphabetic would be nice.
I have a business object that inherits from a bindingsource. Its properties appear to be in an apparent random order in the binding source selection dialog. For example when I'm selecting a property to bind to a text box text property.
|
|
|
|
|
I'm thinking you might be able to do something like that by inheriting from ExpandableObjectConverter. I'm not sure, but it'll give you something to try out.
public class MyClass : ExpandableObjectConverter
{
public override bool GetPropertiesSupported(ITypeDescriptorContext context)
{
return true;
}
public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
{
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(value, attributes);
return properties.Sort(new string[] {"Name", "Value"});
}
}
|
|
|
|
|
That was just the lead that I needed. I'm inheriting from a bindingsource and it implements ITypedList which has the GetItemProperties function. I overrode that function and simply added .Sort to base.GetItemProperties(listAccessors)
Thanks
|
|
|
|
|
Excellent. That's much more elegant. I believe my suggestion was a carry-over from 1.0 days. I know I did something like that (probably for a property grid) a long time ago.
|
|
|
|
|
I want to write codes of an adjusted affine transformation which works interactly. And my question is,
The user, browses and opens a picture file. I would like to get the pixel coordinates (x,y) of a point which is clicked by mouse. So, an event should be done. i am planning to write this in C# but if u have any ideas in other programming languages, please, don't hesitate to write. : )
Thank you.
|
|
|
|
|
I'm guessing you're putting the picture in the picture box, so you can add a PictureBox1.MouseClick event and in the event you can get the coordinated like this: e.X (for the X coordinate) and e.Y , or alternately: e.Location.X ,e.Location.Y
|
|
|
|
|
You can use javascript.
on_click event, use following code
tempX = event.clientX + document.body.scrollLeft;
tempY = event.clientY + document.body.scrollTop;
Nana
|
|
|
|
|
Thank you for your responds. pictureBox tool has an event like this but i couldn't see.
|
|
|
|
|
I have a textbox and two radio buttons. If the value in the textbox is negative, radiobtn2 should be selected otherwise if it is positive radiobtn1 should be selected.
First, the code:
this.textbox1.Leave += new System.EventHandler(this.textbox1_Leave);
private void textbox1_Leave(object sender, System.EventArgs e)
{
string firstchar = textbox1.Text.Trim().Substring(0, 1);
//MessageBox.Show("function called");
if(firstchar == "-")
radiobtn2.Select();
else
radiobtn1.Select();
}
The strange behavior is:
1) that his works if I Tab out of the textbox but not if I click out of the textbox.
2) I put a simple messagebox.show in the textbox1_Leave function to see if it was being called, and the messagebox appears when I click out of the textbox and the code then works with a radiobtn being selected! This tells me the function is being called, but when I remove messagebox.show the function again no longer works!
I also tried changing the EventHandler from Leave to LostFocus and the same behavior exists.
Any ideas why this is or what I can do to work around it without having the user's progress be interrupted?
Thanks,
RABB17
"Nothing fancy needed, please just solve all our problems as quickly as possible."
|
|
|
|
|
use radiobtn1.Checked = true; instead of Select
|
|
|
|
|
Thanks Sharpie that worked perfectly! Another example of being too close to the problem
Thanks again,
RABB17
"Nothing fancy needed, please just solve all our problems as quickly as possible."
|
|
|
|
|
hi,
does anyone know how i can copy a complete dir, including subdirs and files to another drive, using c# ?
or do i have to copy each dir separate ?
thx
Kurt
|
|
|
|
|
Try this link. http://www.aspemporium.com/howto.aspx?hid=20[^]
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
|
Use LocalFileSystem objLm = new LocalFileSystem();
objLm.UploadDirectory(source, destination, pattern);
Nana
|
|
|
|
|
Hi,
I have a C# Desktop solution in which there are many projects. When i press Alt+TAB to switch between other opened application, there is no icon displayed against my running application. Please guide me how can i set it for my application.
Regards,
Wasif Ehsan.
|
|
|
|
|
I believe alt-tab uses the icon of the executable. If your program is not showing at all then you might want to make sure your application is shown in the taskbar.
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[ ^]
|
|
|
|
|
No sir. Its showing in the taskbar. Even it is showing the icon associated with its exe but the Icon on Alt+Tab is not showing.
|
|
|
|
|
I have 2 resource files for languages in my project and when i compile the project it creates two folders in the folder with the exe, a folder for each language DLL.
now, how can i tell the compiler to put them both in a "Languages" directory?
|
|
|
|
|
sharpiesharpie wrote: how can i tell the compiler to put them both in a "Languages" directory?
I don't think you can. IIRC, .NET had a defined order in which to search for satellite assemblies in order for it to determine which languages the resources are available in.
|
|
|
|
|
but can't i just change like...the link?
tell the compiler to compile those DLLs into a different folder?
and maybe i didn't explain myself clearly, those are not VS dlls, those are resources i created.
|
|
|
|
|
What you've described, as far as I can tell, are satellite DLLs - they contain just the culture specific resource information. They go in subfolderes named after the langauge descriptor, e.g. en-gb, en-us, nl-nl, nl-be, es-es, es-mx, fr-fr, fr-be, fr-ca, etc.
If this is not what you are seeing then maybe you could post a summary of the pertinent files with a path.
|
|
|
|
|
it is..so there's no way to change the folder they're stored at?
|
|
|
|
|
sharpiesharpie wrote: so there's no way to change the folder they're stored at?
Not that I'm aware of. However, it has been a while since I did any localisation stuff and that was with .NET 1.1. From my recollection the satellite DLLs need to go in a specific location relative to the assembly they contain the resources for in order for the resources to be picked up. If the files are not there then .NET will revert to the next nearest version that it can find. e.g. The computer's culture is set as de-at (German as spoken in Austria) but there are no DE-AT satellite assemblies. It will revert to DE (generic German) if available. If not, then it will revert to the neutral culture which is the default your application was built with.
|
|
|
|