PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework repost - Re: Can't get TextBoxEx Numeric working

Reply

repost - Re: Can't get TextBoxEx Numeric working

 
Thread Tools Rate Thread
Old 23-12-2004, 06:51 PM   #1
Hank
Guest
 
Posts: n/a
Default repost - Re: Can't get TextBoxEx Numeric working


This thread was getting old and stale, but still unresolved, so I thought I
would bring it to the top. - Hank

I tried putting it in the load event, same problem. I take it you wanted to
see Style get set later, so I took it to the extreme and moved it to a
button and set it from there manually. Same problem.
Hank

"Peter Foot [MVP]" <feedback@no-spam.inthehand.com wrote in message
news:%23uVNtD65EHA.1292@TK2MSFTNGP10.phx.gbl...
It may be a timing issue with when the control is created and hence whether
the handle is valid - if it isn't created at the time the handle is accessed
it may return an invalid handle and the message to set the input mode may
fail. Try removing the code to set the Style from the designer code and call
it in Form_Load instead.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

"Hank" <sorry@noway.com wrote in message
news:10sgen9rs2g825f@corp.supernews.com...
My device is an iPaq 1900 series.

Strange. I created a new project and TextBoxEx works for Numeric there
(both
device and emulators). But it still won't work on the project I've been
working on and of course, need it to work on. I've tried deleting the
TextBoxEx control from the form, removing all OpenNETCF stuff on the
toolbar, removing all references to OpenNETCF, closing VStudio, and then
re-adding the TextBoxEx to the toolbar and the reference in the project.
No
go. Doesn't work on emulators either.

The TextBoxEx control is on a tabpage, so I added a new one just directly
on
a form (different form) to see if maybe being on a tabpage made a
difference, but it still didn't work. I'm making sure I'm setting the
style
property to Numeric. I've tried setting that property in the constructor
and
in the load event.

I really don't see anything exceptional about my project. I've switched
from
using ApplicationEx.Run() and Application.Run() and no difference. The
only
thing in my project that's a little different is a reference to an Oracle
Lite dll.

I've soft resetted the device, deleted application folder on the device --
everything I can think of. Somehow it must be something about my project,
because that the only place it doesn't work.

Nifty control, would really like to use it in several places in my app.

Hank

"Peter Foot [MVP]" <feedback@no-spam.inthehand.com wrote in message
news:e5MjDez5EHA.2600@TK2MSFTNGP09.phx.gbl...
What device type are you targetting? Does it work on the emulator?

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

"Hank" <sorry@noway.com wrote in message
news:10seo9ajjl0796@corp.supernews.com...
Was using Application.Run(form) in my Main(). Just now switched to
ApplicationEx.Run(form), if that's what you mean, and I still have the
same
problem. Didn't know about ApplicationEx.


"Alex Feinman [MVP]" <public_news@alexfeinman.com wrote in message
news:egYunlu5EHA.2600@TK2MSFTNGP09.phx.gbl...
Are you using Application or ApplicationEx in your Main?

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Hank" <sorry@noway.com wrote in message
news:10sem9ugpdm377c@corp.supernews.com...
I must be doing something wrong with the OpenNETCF TextBoxEx control.

I've set the TextBoxStyle property to Numeric. When I type letters
in
the
textbox, letters appear. Same problem with the other styles.

public MyConstructor()
{
InitializeComponent();
txtOpenNETCF_TextBoxEx.Style = TextBoxStyle.Numeric;
}

I installed the control on the toolbar and dragged it onto the form

I didn't run the .msi installer for the binaries on my machine.
Could
this
be the cause? (I would hope not) I just copied the
OpenNETCF.Windows.Forms.dll into the Windows CE dir, and the
corresponding
dll and xml files in the Designer dir -- copied them from another
machine
where I ran the .msi installers.

Thanks,
Hank















  Reply With Quote
Old 23-12-2004, 09:22 PM   #2
Sergey Bogdanov
Guest
 
Posts: n/a
Default Re: repost - Re: Can't get TextBoxEx Numeric working

Hank,

it seems that the problem is inside TextBoxEx, the window handle of
textbox gets inside constructor, that it's not correct at all. I'll
suggest you a bit rewrite TextBoxEx:

1. remove initialization from contructor

public TextBoxEx()
{
hwnd = setHwnd();
defaultStyle = GetWindowLong(hwnd, GWL_STYLE);
}


2. Put it into the OnParentChanged event.

protected override void OnParentChanged(EventArgs e)
{
hwnd = setHwnd();
defaultStyle = GetWindowLong(hwnd, GWL_STYLE);

base.OnParentChanged (e);
}


.... and notice that the TextBoxStyle now you should set after setting
parent:

TextBoxEx tb = new TextBoxEx();
tb.Location = new Point(10, 10);
tb.Size = new Size(100, 20);
Controls.Add(tb);

tb.Style = OpenNETCF.Windows.Forms.TextBoxStyle.Numeric;


I hope it help,
Sergey

Hank wrote:
> This thread was getting old and stale, but still unresolved, so I thought I
> would bring it to the top. - Hank
>
> I tried putting it in the load event, same problem. I take it you wanted to
> see Style get set later, so I took it to the extreme and moved it to a
> button and set it from there manually. Same problem.
> Hank
>
> "Peter Foot [MVP]" <feedback@no-spam.inthehand.com wrote in message
> news:%23uVNtD65EHA.1292@TK2MSFTNGP10.phx.gbl...
> It may be a timing issue with when the control is created and hence whether
> the handle is valid - if it isn't created at the time the handle is accessed
> it may return an invalid handle and the message to set the input mode may
> fail. Try removing the code to set the Style from the designer code and call
> it in Form_Load instead.
>
> Peter
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off