|
This is just one permutation of what I tried with GetExecutingAssembly( ). If what you're intimating is that I need to try Assembly.GetManifestResourceStream() to retrieve the bitmaps so they can be assigned to my properties, I'll have to explore that later (?). I'm late to hit the road, but thanks so much for trying to set me straight on this. I'll get around to it as soon as I can.
|
|
|
|
|
mike montagne wrote: If what you're intimating is that I need to try Assembly.GetManifestResourceStream()
intimating? Since this is a forum based conversation I don't know how more clearly to state it than putting it directly in the post which I did.
led mike
|
|
|
|
|
In other words, we can get so far as acquiring a "ModuleHandle" from GetExecutingAssembly -- but I can do this with GetAssembly as well:
Assembly.GetExecutingAssembly( ).GetModule( "APC" ).ModuleHandle; ModuleHandle however is a struct with no field or conversion method which converts to an IntPtr to the instance of the assembly. That's the missing piece: How to get an IntPtr from the assembly, or something else, which identifies the executable containing the resource.
GetExecutingAssembly just looks like another course to the same dead end to me, unless we can get that IntPtr somehow.
But thanks for the try!
m
|
|
|
|
|
i guess you are confusing managed and unmanaged resources.
try using reflector to see whether it is a .net managed resource.
|
|
|
|
|
No, my resource is managed. I've added many bitmaps to my class library DLL by the visual process, Project.Add... Existing file...
Determining whether it is a managed resource is not the problem. The DLL is loaded by a test application, using the classes as they would typically be deployed. The problem is for the class, when it is in the test application (exe), to assign the bitmap resources to property, preferably with the Bitmap.FromResource( IntPtr hinstance, String bitmapName ) method.
|
|
|
|
|
|
Whoa. Jumps out and grabs you when it's in Bold!
I guess I need to learn to *read*! I suppose I was so intent on loading and embedded resource I just assumed this was the method (what other method is there?). So this *does* require calling into LoadLibrary to get the hinstance.
I'm going to have to look around to see what method to use to retrieve my managed resources, because that's the way I want to do it. I hope that isn't some odd implementation of "FromFile", even as the resources are managed -- maybe so?
|
|
|
|
|
mike montagne wrote: I'm going to have to look around to see what method to use to retrieve my managed resources
In fact it's rather easy. Just use the Windows Forms designer and assign an image (e.g. to a PictureBox).
Then take a look at the MyForm.Designer.cs file and see the designer-generated code that loads from the resource.
Adapt it and do it in a similar way.
|
|
|
|
|
|
|
Hi,
I need to create a mouse dragbox type of event, much like when you click and drag the mouse on the desktop, it creates the dotted line "box".
Does anyone know of any articles on how to do this?, i've thought of listening to the mouse click/move event and then drawing a rectangle from the posistions, but it would be much easier if there was a inbuilt event.
Regards,
Gareth.
|
|
|
|
|
gareth111 wrote: Does anyone know of any articles on how to do this?
Ever heard of Google[^] ?
led mike
|
|
|
|
|
Yes i have heard of google, but i dont see how your link helps me since i didnt ask for the DragDrop event and i cant find anything in the DragDrop that looks like what i need to do.
Regards,
Gareth.
|
|
|
|
|
Can we add a textbox & button to a listview
|
|
|
|
|
Sure. You can descend a class from Control, and add a textbox, button, and listview to it.
|
|
|
|
|
what is the sample code for that...?
|
|
|
|
|
Evidently, Uwe believes your question pertains to adding the textbox and button to a subcomponent. My interpretation of your question is that you want to add a textbox and button to an exterior region. To do so, you would probably want to derive a root or base layer from Control or UserControl, and add your ListView, TextBox and Button to that.
|
|
|
|
|
|
I would like to know if it is possible to have different icons for the same window in the title bar and in the taskbar..
I think that everything is possible but..
Anyway.. if someone have something to help me it would be appreciate..
Thanks
Luc
|
|
|
|
|
I could be wrong, but I don't think there's a practical way to do that. The Task Bar reads the icon from the executable -- you don't have an obvious opportunity to pass an alternate icon to system processes managing the Task Bar.
|
|
|
|
|
That's also my conclusion, but there's absolutely no way to do that?
No hack or tricky tricks?
|
|
|
|
|
I know I've seen an example of how to draw a rectangle on the desktop in response to mouse drag events, but I can't recall where. It's been a while. You should be able to dig up an example.
|
|
|
|
|
|
kubben, there's nothing about the tray in what i want to do.
I just want to have different icon in my titlebar and taskbar.
|
|
|
|
|
what would this be good for?
|
|
|
|