|
I have to disagree, at least w/respect to how Windows Explorer works. If I left click Folder "A" in explorer to select it, then right click on folder "B" and select "properties" I get a property page for folder "B", not folder "A".
This is the behaviour on Windows 2000.
If I were programming with pure Win32, I would just do a hit-test on the item under the mouse cursor, but I can't find an analog in C#.NET.
Thanks,
Rick
|
|
|
|
|
rhoward wrote:
If I left click Folder "A" in explorer to select it, then right click on folder "B" and select "properties" I get a property page for folder "B", not folder "A".
Correct, but when you close the property page the folder "B" *isn't* selected, folder "A" is. Sorry I didn't make that clear in my posting.
James
|
|
|
|
|
Sorry for the misunderstanding. You are definitely correct about "A" still being selected.
The point I was making is that Explorer displays properties for "B", not "A", which is what I was trying to achieve.
Thanks,
Rick
|
|
|
|
|
As James said, that is by design. The way to work around the design is like so:
treeView1.SelectedNode = treeView1.GetNodeAt(e.X, e.Y);
Call that before you pop-up the context menu
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
Many thanks, David.
I was able to use GetNodeAt() in the MouseUp event for the tree to reset the selected node to the proper item.
Thanks again,
Rick
|
|
|
|
|
I have component object that handles controls in a typesafe array like so
<br />
[Designer(typeof(ComponentGen.Repository.CompGenDesigner))]<br />
public class CompGen : System.ComponentModel.Component<br />
{<br />
private ComponentGen.Collections.CtrlCollection c_ctrls = null;<br />
...<br />
}<br />
when the controls are added to the component using the design wizard, the form's Initialize() event adds this code:
<br />
this.compGen1.RepositoryControls.AddRange(new System.Windows.Forms.Control[] { this.MASTER, this.CATEGORY, this.TEST_CODE});<br />
...<br />
<br />
this.Controls.AddRange(new System.Windows.Forms.Control[] { this.MASTER, this.CATEGORY, this.TEST_CODE});<br />
...<br />
*MASTER, CATEGORY, and TEST_CODE are the generated controls (System...Control wrapped controls)
The problem
when the controls are first drawn, they show up perfectly drawn. when the form is closed and re-opened, the controls are not redrawn (transparent) but still exist and work perfectly when run.
The problem goes away when the controls are not added to the repository in that Initialize code.
Questions, Leads
-Do i have to override a paint or something in either the controls designer or the repository component?
-Why is simply adding references to the components in a collection stopping the form from repainting the controls?
|
|
|
|
|
This is a good question and im surprized ive got nothing so far. but right clicking on a tree gets four replies in an hour! come now. where have all the gurus gone?
|
|
|
|
|
poodull wrote:
Do i have to override a paint or something in either the controls designer or the repository component?
Are MASTER, CATEGORY, and TEST_CODE controls of your own design or ones provided elsewhere?
Now my second question; what do you mean by a repository component? To me that would be a component which stores other components for later use; is that correct?
poodull wrote:
Why is simply adding references to the components in a collection stopping the form from repainting the controls?
Ensure that the Parent property is set to the proper entity, ie if the controls should be on the form Form1, Parent should be a reference to Form1.
James
|
|
|
|
|
James T. Johnson wrote:
Are MASTER, CATEGORY, and TEST_CODE controls of your own design or ones provided elsewhere?
MASTER, CATEGORY, and TEST_CODE are extended System...Controls I built. They have their own designer which i built, but really only adds a verb.
James T. Johnson wrote:
Now my second question; what do you mean by a repository component? To me that would be a component which stores other components for later use; is that correct?
Its a UI-less component which reads xml and creates these wrapped controls on the form using it's(the component) own designer. the designer also adds the controls to the component's public arraylist of controls.
James T. Johnson wrote:
Ensure that the Parent property is set to the proper entity, ie if the controls should be on the form Form1, Parent should be a reference to Form1.
The parent object does reference Form1. during design and runtime.
btw, thanks for the reponse.
|
|
|
|
|
already kicked to the second page.. oh well...
the answer was that i was overriding OnVisibleChanged() for no reason and not doing anything about it. which would make all the contained controls in my generated controls disappear.
so, im an idiot, but im still shocked i didnt get more prods on this one.
thanks james
|
|
|
|
|
If I examine the propertyItems of a jpg file that was created using my digital camera I see that there is thumbnail related metadata. I have not been able to preserve the thumbnail data when using Image.Save(). Some metadata is preserved, but the thumbnail data is lost. Does anyone know what it takes to preserve the thumbnail metadata?
David
|
|
|
|
|
Could you e-mail such a jpg to me?
I can only guess without one.
James
|
|
|
|
|
I emailed one to you this morning.
Let me know what you find.
Thanks.
|
|
|
|
|
Yep, I got it this morning; I was very busy up until a few minutes ago so I just started looking in to it.
James
|
|
|
|
|
I'm not getting that behavior at all.
If I open the image then save it the thumbnail data is preserved.
Just a guess, but perhaps some operation you are performing is creating a new image; and when you save the jpg it creates the other metadata; but not the thumbnail.
James
|
|
|
|
|
Interesting.
You found a propertyitem id indicating thumbnail data on the saved image?
The code is at home and I am at work so I can't give you more details until later. But I don't think there was much to it. It was something like:
Image myImage = Image.LoadFromFile("test.jpg");
myImage.Save("test_new.jpg"); and myImage.Save("test_new.jpg",ImageFormat.jpeg);
Both calls lost the propertyid items related to thumbnails.
I can post the exact code tonight.
David
|
|
|
|
|
dsweet wrote:
You found a propertyitem id indicating thumbnail data on the saved image?
Yep, I've uploaded the source to my test program. It has no error checking, so you need to follow the order correctly First load the image, then load the attributes; double click on the thumbnail data (has ~4K of data with it) to view the thumbnail; then click save to have it save the image as C:\test2.jpg.
Here is a test image to use for it if you don't have one with thumbnails...test.JPG (820.8 Kb)
James
|
|
|
|
|
Thanks a lot! I will run it on my PC tonight and see if I get the same results.
David
|
|
|
|
|
Bad News (for me).
The code you sent me did not produce the same results.
After saving test2.jpg and then reloading it, the tag (20507) was gone!
Do I need a new version or something?
Help-About states that I have .net framework 1.0.3705. What are you using?
David
|
|
|
|
|
Wow, this is too weird.... What OS are you on?
I'm running XP Pro with all the latest updates. I'll try my 2k server box in a second.
James
|
|
|
|
|
Ok, just tried it on my 2k box and it is missing the thumbnail data. I think this qualifies for bug material.
Can anyone confirm what happens on 98/ME/NT4/XP Home? Follow the directions in this post.
James
|
|
|
|
|
Running winver I get :windows 2000 ver 5.0(build 2195: Service Pack 2)
.net framework: ver 1.0.3705.
No thumbnails.
|
|
|
|
|
On NT 4.0 sp6a there are no thumbnails either.
|
|
|
|
|
Erick Ellis (MS) suggested installing this QFE.
Backup the gdiplus.dll in your %WINDIR%\Microsoft.NET\v1.0.3705\ .
Now since the QFE is made for Windows XP you'll need to use Winzip to extract the files. Then place the new gdiplus.dll in the v1.0.3705 directory.
I'm hoping this is just a temporary fix until the updated gdiplus.dll is included with .NET SP2.
James
|
|
|
|
|
That worked on my NT system here at work.
Thanks for your help.
David
|
|
|
|