Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Developer Outlook Addins > OL 2007 Form Re...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 1651 of 1746
Post > Topic >>

OL 2007 Form Region Textbox.MouseIcon Problem

by Tom1247 <tom1247@[EMAIL PROTECTED] > Feb 14, 2008 at 03:10 PM

I have the following code to assign a value to the MouseIcon property
of a textbox control in an OL 2007 form region. I use this exact code
numerous places to assign values for icons, pictures, etc. without a
problem but when used for the MouseIcon property it throws a 'Value
does not fall within the expected range' error at the line assigning
the property. Everything else works fine - the control is correctly
declared, the MousePointer accepts the custom (99) value but the
property assignment throws an error. HAND is in the resources and is a
PNG file 32x32, but I've tried 16x16, even an .ico file and a .cur
file all to no avail. What am I missing?

m_Textbox = DirectCast(m_Form.Controls.Item("TextboxName"),
Outlook.OlkTextBox)

Dim imgStreamPic As System.Drawing.Image
Dim oPic As IPictureDisp = Nothing
Dim ax As MyAxHost = New MyAxHost()
Try
    m_Textbox.MousePointer =
Outlook.OlMousePointer.olMousePointerCustom
    imgStreamPic = My.Resources.HAND
    oPic = ax.IPictureDispFromImage(imgStreamPic)
    m_Textbox.MouseIcon = DirectCast(oPic, stdole.StdPicture)
Catch ex As Exception
 
Debug.WriteLine(System.Reflection.MethodBase.GetCurrentMethod.Name)
    Debug.WriteLine(ex.Data)
    Debug.WriteLine(ex.Message)
    Debug.WriteLine(ex.Source)
    Debug.WriteLine(ex.StackTrace)
Finally
    ax = Nothing
    oPic = Nothing
    imgStreamPic = Nothing
End Try

Thanks!
 




 4 Posts in Topic:
OL 2007 Form Region Textbox.MouseIcon Problem
Tom1247 <tom1247@[EMAI  2008-02-14 15:10:42 
Re: OL 2007 Form Region Textbox.MouseIcon Problem
"Ken Slovak - [MVP -  2008-02-15 09:36:18 
Re: OL 2007 Form Region Textbox.MouseIcon Problem
Tom1247 <tom1247@[EMAI  2008-02-15 07:11:20 
Re: OL 2007 Form Region Textbox.MouseIcon Problem
"Ken Slovak - [MVP -  2008-02-15 12:00:53 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 16:07:53 CST 2008.