Solved

Inherited NumericUpDown control intermittently creates errors.

Posted on 2008-10-28
2
386 Views
Last Modified: 2013-12-26
I have written a VB program in Visual Studio 2008 - for mobile devices.

The program required a NumericalUpDown control, which I found, but the compact framework version doesn't support the .Select method like the full framework does. Therefore, I found this work-around, which works absolutely fine: http://blog.markarteaga.com/CommentView,guid,85271d7d-14a1-41dd-8469-d230a4e609cf.aspx which basically inherits the control and PInvoke SendMessage in coredll.dll does the text select.

 The problem I have is that every so often, with no seaming pattern to it, Visual Studio puts:

CType(Me.txtIncrementValue, System.ComponentModel.ISupportInitialize).BeginInit()

at the beginning and:

CType(Me.txtIncrementValue, System.ComponentModel.ISupportInitialize).EndInit()

at the end of my form's InitializeComponent sub.

This causes a few different errors, but basically prevents the form/app from then loading. All I do is remove these lines or comment them out and then it's fine again for the next few compiles until it feels like messing me around again.

Any ideas either why it feels it need to puts these lines in, or how I can stop it falling over if they remain?

One of the errors I get is:

{"Message text unavailable.  Resource file 'Microsoft.VisualBasic resources' not found."}

Trace:
"   at EskiMobile.My.MyProject.MyForms.Create__Instance__[T](frmMain Instance)\r\n   at EskiMobile.My.MyProject.MyForms.get_frmMain()\r\n   at EskiMobile.frmMain.Main()\r\n"

Unfortunately the site no longer is accepting comments, so I cannot go back there to ask the question.
0
Comment
Question by:JedNebula
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 1

Author Comment

by:JedNebula
ID: 22848526
Here is a screenshot - in case it helps.
InvalidCast.jpg
0
 
LVL 1

Accepted Solution

by:
JedNebula earned 0 total points
ID: 22857687
Found the answer in the end. I had to Implement System.ComponentModel.ISupportInitialize
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question