|
You need to atleast install the .NET resdistributable. You can't install SDK to development but you can run .NET apps
|
|
|
|
|
All,
For a while, I have searched for information creating and using "grab handles." At this point, the only thing I have found is some weak information on the MSDN on DrawGrabHandle. Does anyone know of a good resource for this?
Thanks In Advance,
Rich
|
|
|
|
|
I got the following code:
using System;
namespace AbelSoft.LudoGame
{
///
///
///
public class Piece : System.Drawing.Image
{
public Piece()
{
}
}
}
and this is the error i got:
C:\Documents and Settings\Franck-Alain\My Documents\Visual Studio Projects\LudoGame\Piece.cs(10): 'System.Drawing.Image.Image()' is inaccessible due to its protection level
|
|
|
|
|
franck_alain wrote:
'System.Drawing.Image.Image()' is inaccessible due to its protection level
This looks like it is a sealed class, hence you would not be able to derive your own class from it.
If you need a graphics object, you can override the OnPaint method.
Nick Parker
|
|
|
|
|
Why is it that when I right click on a tree node and my context menu pops up, the item that is returned by the treeView1.SelectedNode property is not the item that was right-clicked on, but whatever tree node happend to be selected before the right click?
i.e.
Folders
_________
|FolderA| <-- Currently selected tree node
---------
FolderB
FolderC <-- Right click here
treeView1.SelectedNode returns FolderA, not FolderC, even thought the selected node highlighting box temporarily moved to FolderC.
Scratching my head...
Thanks,
Rick
|
|
|
|
|
Thats just the way the TreeView works. Crappy answer, but if you look at the behavior in Windows Explorer it is the same.
I believe the justification is that selecting the node is so you can tell which node was right-clicked on. Right clicking should not select an item; you are merely requesting a menu to popup.
James
|
|
|
|
|
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
|
|
|
|