|
-
Jul 1st, 2003, 02:20 AM
#1
Thread Starter
Addicted Member
User control & toolbox icon?
I provide toolbox icon for my control like this:
<ToolboxBitmap("C:\nb.bmp")> _
Public Class MyControl
and that works fine, but when I want to use my control on another computer, I must have .bmp file at the same location like on my computer (in this case 'C:\nb.bmp'). My question is: how to compile my control in that way that it contain .bmp file? Is that possible?
regard j
-
Jul 1st, 2003, 02:37 AM
#2
Re: User control & toolbox icon?
Originally posted by janis
I provide toolbox icon for my control like this:
<ToolboxBitmap("C:\nb.bmp")> _
Public Class MyControl
and that works fine, but when I want to use my control on another computer, I must have .bmp file at the same location like on my computer (in this case 'C:\nb.bmp'). My question is: how to compile my control in that way that it contain .bmp file? Is that possible?
regard j
well you have to convert it to a resource file... gotto search the forum
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Jul 1st, 2003, 06:19 AM
#3
Are you using the standard .NET installation project to install your program?
If so, you just need to get the installation project to add the .bmp to the executable's installation directory. Your code can then find it through something like this:
VB Code:
Dim strPath As String = _
Path.GetDirectoryName(Application.ExecutablePath) & _
Path.DirectorySeparatorChar
This world is not my home. I'm just passing through.
-
Jul 1st, 2003, 08:35 AM
#4
Thread Starter
Addicted Member
That's not a program, it's only one control which I want to use on some other computer for develop other applications.
I think that MrPolite has right
you have to convert it to a resource file
only problem is I don't know how to do that?
I somebody know the way please share with us.
regard j
-
Jul 1st, 2003, 08:53 AM
#5
Addicted Member
-
Jul 8th, 2003, 03:19 AM
#6
By far the easiest way...
Hi Guy's.
The easiest way to add a toolboxbitmap is this:
If you have a control called TestControl, then just add a bitmap called
TestControl.bmp to the project, and compile it as an embedded
resource.
That's all. No need for attributes or anything else.
You won't see the change right away, but the
next time you add the tool to the toolbox, the bitmap
will be there.
BTW: The lower left pixel determines the transparent color.
(I think it the lower left....At least it's one of the corners!)
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|