PC Review


Reply
Thread Tools Rate Thread

repost - Re: Can't get TextBoxEx Numeric working

 
 
Hank
Guest
Posts: n/a
 
      23rd Dec 2004
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]" <(E-Mail Removed) wrote in message
news:%(E-Mail Removed)...
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" <(E-Mail Removed) wrote in message
news:(E-Mail Removed)...
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]" <(E-Mail Removed) wrote in message
news:(E-Mail Removed)...
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" <(E-Mail Removed) wrote in message
news:(E-Mail Removed)...
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]" <(E-Mail Removed) wrote in message
news:(E-Mail Removed)...
Are you using Application or ApplicationEx in your Main?

--
Alex Feinman
---
Visit http://www.opennetcf.org
"Hank" <(E-Mail Removed) wrote in message
news:(E-Mail Removed)...
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
 
 
 
 
Sergey Bogdanov
Guest
Posts: n/a
 
      23rd Dec 2004
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]" <(E-Mail Removed) wrote in message
> news:%(E-Mail Removed)...
> 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using the textboxex class =?Utf-8?B?UmlnYQ==?= Microsoft Dot NET Compact Framework 3 29th Jul 2005 10:14 AM
OpenNetCF TextBoxEx has no new properties - help! =?Utf-8?B?ZGFuX3NvbW1lcg==?= Microsoft Dot NET Compact Framework 4 12th Jan 2005 08:09 PM
Can't get TextBoxEx Numeric working Hank Microsoft Dot NET Compact Framework 7 21st Dec 2004 10:43 PM
SQL Statement Not Working (Repost of Criteria Not working but in SQL view) =?Utf-8?B?Tmljb2xl?= Microsoft Access Queries 1 15th May 2004 10:02 AM
Fill Textboxex with Corresponding Record active_x Microsoft Excel Programming 1 16th Sep 2003 11:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:21 PM.