Wrox Programmer Forums
|
BOOK: Visual Basic 2005 Programmer's Reference
This is the forum to discuss the Wrox book Visual Basic 2005 Programmer's Reference by Rod Stephens; ISBN: 9780764571985
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Visual Basic 2005 Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 21st, 2006, 08:10 AM
Registered User
 
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm having the problem with ToolBoxBitmap attribute, and none of the solutions work in my environment.

Also I tried to access bobpowell site, and it does not work.

Do you have a project in wich it works ?

Thanks in advance.



Quote:
quote:Originally posted by Rod Stephens
 > Rod, i found it myself (i use me.) is it right?
Exactly.

> <ToolboxBitmap(gettype(Tbox),"Textbox")>_
>
> 'here Tbox is my class
> 'Textbox is the name of the bitmat (I add
> Textbox.bmp into the resources)

This is something Microsoft seems to have really messed up. I have had terrible luck getting this to work.

There's a very informative article at:

    http://www.bobpowell.net/toolboxbitmap.htm

But I still have trouble if teh namespace has been changed.

I recommend one of two approaches.

1. Use the other version of the ToolboxBitmap attribute where you pass in the full path to the bitmap file as in:

    <ToolboxBitmap("C:\MyCotrols\Tbox\Textbox.bmp")> _

This seems heavy-handed because you'll need to change the code if you move the project but at least it's easy to understand.

2. Ensure that the project's root namespace matches the assembly's name. Double-click My Project, go to the Application tab, and make sure the Assembly Name and Root Namespace match. Then select the resource file in Project Explorer (Textbox.bmp in your case), go to the Properties window, and set Build Action to Embedded Resource. Finally, use a statement like this:

    <ToolboxBitmap(GetType(Tbox), "Textbox")> _

What a mess, huh? I haven't had a chance to try anything with the resfinder class suggested in that article.

If anyone has a better more consistent solution, please let me know!


Rod
RodStephens@vb-helper.com
Author of "Visual Basic 2005 Programmer's Reference"
http://www.vb-helper.com/vb_prog_ref.htm

Sign up for the free VB Helper Newsletters at http://www.vb-helper.com/newsletter.html
 
Old June 23rd, 2006, 08:09 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

> Also I tried to access bobpowell site, and it does not work.
It looks like it's working now.

This example should work, although I think it's VB 2003:

    http://www.vb-helper.com/howto_net_gauge_control.html

Be sure the bitmap's BuildAction is EmbeddedResource. And you may need to manually remove and re-add the control in the toolbox to get the icon to show up properly.


Rod
RodStephens@vb-helper.com
Author of "Visual Basic 2005 Programmer's Reference"
http://www.vb-helper.com/vb_prog_ref.htm

Sign up for the free VB Helper Newsletters at http://www.vb-helper.com/newsletter.html
 
Old June 27th, 2006, 11:21 PM
Authorized User
 
Join Date: Jan 2006
Posts: 43
Thanks: 1
Thanked 0 Times in 0 Posts
Default

hi, one more doubt,

im creating my own textbox now, all i want is that the ENTER key press should act like TAB (im now using the keypress event to catch the ENTER key and use Sendkeys(TAB)) Is there any genuine way to emulate the TAB key .

 
Old June 28th, 2006, 07:47 AM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

The traditional method is to catch the KeyPress event, set the key to 0 to cancel it, and then use SendKeys to send a tab character. See this VB 6 example:

    http://www.vb-helper.com/howto_treat..._like_tab.html


Rod
RodStephens@vb-helper.com
Author of "Visual Basic 2005 Programmer's Reference"
http://www.vb-helper.com/vb_prog_ref.htm

Sign up for the free VB Helper Newsletters at http://www.vb-helper.com/newsletter.html





Similar Threads
Thread Thread Starter Forum Replies Last Post
about picturebox inherit youtubeline C# 3 December 12th, 2008 03:41 PM
Chapter 7, Inherit keyword not working VictorVictor BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 2 April 12th, 2006 12:13 PM
Can we Inherit ADODB venki5star Visual Studio 2005 3 March 13th, 2006 10:50 AM
Inherit Exception or ApplicationException organicglenn BOOK: ASP.NET Website Programming Problem-Design-Solution 3 March 27th, 2004 10:42 PM
the inherit problem in java code. benni J2EE 6 November 13th, 2003 06:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.