|
-
Feb 21st, 2005, 09:21 AM
#1
Thread Starter
Member
simple problem with mobile pc applicaiton
i have developed a form based application for mobile pc. i have kept the form small, so that i dont occupy all the screen. however still it is occuping all the space and i cant use the typewriter to enter values. help me about this
-
Feb 21st, 2005, 11:10 AM
#2
Fanatic Member
Re: simple problem with mobile pc applicaiton
make sure you have set the window state to normal, and dont expicitly in your set the size of the window to be bigger than you want it.
maybe try putting in the form_load
me.height = 200
me.width = 200
-
Feb 21st, 2005, 11:39 AM
#3
Re: simple problem with mobile pc applicaiton
Frankly, you have very little space on a PDA, and that is how it will have to be.
If you feel that you have sufficient space for your controls and the keyboard, then that is good. If you don't have enough space, you will have to split the controls onto different "forms".
I put the forms bit in quotes because I still don't believe that using more than one form is a good idea. Instead, use one form with different panels on it. Any controls on the panel will move with the panel, so if you move a single panel into the screen area, all the controls will move with it. The organizational plan then is to swap panels in and out as needed. Set the left property to 0 on all panels, and the top porperty to 300, or so. Then when you want to show a panel, you simply need to change the top property to 0.
The advantage to this is that it is really fast. There is almost not time cost in swapping panels, whereas there is a potentially significant cost to loading forms (I think Strider posted another alternative that could work, as well).
In either case, have the panel or the form fill the screen, but put the controls above the area where the keyboard will go. If you don't have enough room for that, then you will need multiple screens.
My usual boring signature: Nothing
 
-
Mar 1st, 2005, 05:14 AM
#4
Thread Starter
Member
Re: simple problem with mobile pc applicaiton
Thanks shaggy
i have a task... my applicaiton will be running all the time (like system clock) .... when employee shift time start ( ie: now = emp_shift_start_time) then the application should show emp authentication screen (where employee will enter username & password )... then the applicaiton will load all the current day task for the employee into a dataset...... and when the first task start time begin (ie: now = task_start_time) then that task will be shown .. and when the task expected completion time start (ie: now= task_expected_completion_time) then a DONE button will appear so that employee can press it to confirm task completion.... and when the task end time being (ie: now = task_end_time) .. that task and DONE button should disappear.. and application should move to next task..
i have few questions
1. how should i make my application run all the time (like system closk). so only administrator can stop it and users can't stop it
2. I try to use timer's tick event..but its not working why?
3. how to iterates through the records in the dataset tables? ( in VB6 we have recordset.movenext facility)
4. any more ideas that you people want to share?
Thanks in Advance
--------------------------------------------------------------------
If you have a 1$ and I have a 1$, by exchanging them we still have 1$
But.....
If you have an idea and I have an idea, by exchanging them we have 2 ideas
-
Mar 1st, 2005, 06:16 AM
#5
Fanatic Member
Re: simple problem with mobile pc applicaiton
1. In the form_closing of the main form capture the event 'e' and set this to e.Cancel = True.
This will prevent the user from closing the application, so all you need to do is put in a check to see if the user logged in is an administrator if so let they can stop it
2. Can you explan more what you are trying to do with the timer.
Are you settings the timer enabled to true (timer1.enabled = True)
3. To iterate throught dataset you need to specify the tables you want to look at then iterate through each row. if you are not writing back to the table it is better to use a datareader
Dim l_ctr As Integer = 0
While l_ctr < myds.Tables("TableName").Rows.Count - 1
myds.Tables("TableName").rows(l_ctr).column("ColumnName")
Loop
-
Mar 2nd, 2005, 04:40 AM
#6
Thread Starter
Member
Re: simple problem with mobile pc applicaiton
Thank strider
can u give info about this
1. example of using datareader to get records one-by-one from a single table
2. i want my application to be visible always on the top of any other application. otherwise when user press X button on main screen, my application will be hidden,,,this is not allowed..
3. any info about notification ASP for .NET
-
Mar 2nd, 2005, 04:54 AM
#7
Fanatic Member
Re: simple problem with mobile pc applicaiton
1. Dim selectString As String = "SELECT * FROM tbl_Name"
Dim cmd As OleDbCommand = New OleDbCommand(selectString, DatabaseConnection.getInstance.connection())
Dim reader As OleDbDataReader = cmd.ExecuteReader()
'Loop through the resultant data selection and add the data value
'for each respective column in the table.
While (reader.Read())
listview1.items.add(reader.Item("ColumnName")) 'or reader.Item(0)
End While
reader.Close()
2. look into SHFullScreen. I have attached a sample class below, its just a matter of calling these methods. Note though most work PocketPC 2003 but only some work if you are targeting a Windows CE Device other than the PPC2003
VB Code:
Imports System.Runtime.InteropServices
Public Class BarControl
<DllImport("coredll.dll", EntryPoint:="GetForegroundWindow", SetLastError:=True)> Private Shared Function GetForegroundWindow() As IntPtr
End Function
<DllImport("aygshell.dll", EntryPoint:="SHFullScreen", SetLastError:=True)> Private Shared Function SHFullScreen(ByVal hwndRequester As IntPtr, ByVal dwState As Integer) As Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="EnableWindow")> Private Shared Function EnableWindow(ByVal hwnd As IntPtr, ByVal bEnable As Boolean) As Boolean
End Function
<DllImport("coredll.dll", EntryPoint:="FindWindow")> Private Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
End Function
Private Const SHFS_SHOWSTARTICON As Integer = &H10
Private Const SHFS_HIDESTARTICON As Integer = &H20
Private Const SHFS_HIDESIPBUTTON As Integer = &H8
Private Const SHFS_SHOWSIPBUTTON As Integer = &H4
Private Const SHFS_SHOWTASKBAR As Integer = &H1
Private Const SHFS_HIDETASKBAR As Integer = &H2
Private Shared Function SetTaskBarEnabled(ByVal bEnabled As Boolean) As Boolean
Dim hwnd As IntPtr = FindWindow("HHTaskBar", Nothing)
If Not hwnd.Equals(IntPtr.Zero) Then
If bEnabled Then
Return EnableWindow(hwnd, True)
Else
Return EnableWindow(hwnd, False)
End If
End If
Return True
End Function
Private Shared Function SetTaskbarVisible(ByVal visible As Boolean) As Boolean
Dim hwnd As IntPtr = FindWindow("HHTaskBar", Nothing)
If Not hwnd.Equals(IntPtr.Zero) Then
If visible Then
Return SHFullScreen(hwnd, SHFS_SHOWTASKBAR)
Else
Return SHFullScreen(hwnd, SHFS_HIDETASKBAR)
End If
End If
End Function
Private Shared Function SetStartButtonVisible(ByVal visible As Boolean) As Boolean
Dim hwnd As IntPtr = GetForegroundWindow()
If Not hwnd.Equals(IntPtr.Zero) Then
If visible Then
Return SHFullScreen(hwnd, SHFS_SHOWSTARTICON)
Else
Return SHFullScreen(hwnd, SHFS_HIDESTARTICON)
End If
End If
End Function
Private Shared Function SetSIPVisible(ByVal visible As Boolean) As Boolean
Dim hwnd As IntPtr = GetForegroundWindow()
If Not hwnd.Equals(IntPtr.Zero) Then
If visible Then
Return SHFullScreen(hwnd, SHFS_HIDESIPBUTTON)
Else
Return SHFullScreen(hwnd, SHFS_HIDESIPBUTTON)
End If
End If
End Function
Public Shared Sub ShowTaskBar()
SetTaskBarEnabled(True)
SetTaskbarVisible(True)
End Sub
Public Shared Sub HideTaskBar()
SetTaskbarVisible(False)
SetTaskBarEnabled(False)
End Sub
Public Shared Sub ShowSIP()
SetSIPVisible(True)
End Sub
Public Shared Sub HideSIP()
SetSIPVisible(False)
End Sub
Public Shared Sub HideStartButton()
SetStartButtonVisible(False)
End Sub
Public Shared Sub ShowStartButton()
SetStartButtonVisible(True)
End Sub
End Class
3. No idea about asp notification for .Net. What exactly are you looking for
-
Mar 2nd, 2005, 09:39 AM
#8
Thread Starter
Member
Re: simple problem with mobile pc applicaiton
Sorry strider, i have not put my question clearly...here is what actually i want
1. i have data in xml file. it has only one table. i want to read data from it, one record at a time, till the end of table. how to do it efficiently?
2. i am developing application using VB.NET. I support SHfullScreen is for eVB. what is the alternative for VB.NET.
3. there is one notification API for eVB, is there anything similar to it for VB.NET.
4. you can check my project rrequirement in my previous post. there is one important feature i need in my application. We know that if we open other applicaiton on pocket pc, our application (its form ) will be hidden. What i need is that for a particular timer event, my application window should appear on the screen , no matter which application is presently top-most on the screen. how to do this? this is the real heart of my applicaiton....
-
Mar 2nd, 2005, 09:55 AM
#9
Fanatic Member
Re: simple problem with mobile pc applicaiton
1. If you are importing from xml it may be better to use a dataset as the dataset has a feature where you can read data in from an xml file to the dataset and vice versa.
Dim l_myDs As New DataSet
l_myDs.readXML(fileName)
l_myDS.WriteXML(fileName)
2. the code for the SHfullScreen works in CF.net as i have used this in several projects. it disables the taskbar and startmenu so the user cannot launch any other application hence preventing yours from being put in the background.
3. Have no idea what notification API is. Done very little EVB
4. Should be answered as part 2
-
Mar 2nd, 2005, 09:56 AM
#10
Fanatic Member
Re: simple problem with mobile pc applicaiton
this site may help answer some of your question and give you sample code
-
Mar 9th, 2005, 04:19 AM
#11
Thread Starter
Member
Re: simple problem with mobile pc applicaiton
thanks strider!!!
1.can u explain...the below code...that you write in sample class
<DllImport("coredll.dll", EntryPoint:="FindWindow")> Private Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
End Function
Private Const SHFS_SHOWSTARTICON As Integer = &H10
Private Const SHFS_HIDESTARTICON As Integer = &H20
-- here what is <dllimport > and &H10
2. i want to BEEP or play sound when timer reaches a certain time.. i am using beep function, but no sound is coming... any other alternative to make a big alarm sound.
3. when i use your SHfullscreen functions i can hide START button, but still the VOLUME icon, phone icon, etc are visible in top. how to hide them....the problem is that if we dont hide them, then user can click on them and then we he click the taskbar, the start button is again appearing, which is completly destroying the purpose of using SHFULLSCREEN.
4. i want to store just hour and minute in my database. but if we use date/time datatype, seconds are automatically get 00. however when i convert table into xml, the time is ok, but it is taking as today's date in date portion of variable. i just want hour and minute in my data. .. i also dont want to use string or integer variables...
-
Mar 9th, 2005, 04:49 AM
#12
Fanatic Member
Re: simple problem with mobile pc applicaiton
1. Here the code is using the core.dll which is located on the device. Coredll.dll is the main system dll for Windows CE and contains Win32 API functions, such as those shown in the code (Hiding SIP, Taskbar etc) and more.
Look at microsoft site to find other function such as playing sounds and running threads etc.
2. Should be answered as part of the first question..
3. Answer you cant hide then, but disabling the taskbar and startmenu disables their functionality so if the user clicks on them it does NOTHING. This all works for me by simply in my main controller class of the application adding the following code
VB Code:
Dim bc As New BarControl
bc.HideStartButton()
bc.HideTaskBar()
bc.HideSIP()
Beware you need to enable all of these before exiting the appilcation otherwise they will stay disabled
4. It you want to extract part of the time use the substring function to just get the HH:MM part of the time or check out FormatDateTime() in .NET
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Mar 9th, 2005, 06:10 AM
#13
Thread Starter
Member
-
Mar 9th, 2005, 09:05 AM
#14
Thread Starter
Member
Re: simple problem with mobile pc applicaiton
Oops!
everything is working fine if we disable as per your code, BUTTTTT .. if the pocket pc is having phone facility and if you press phone button..then phone dialer is coming........how to disable this also........
2. what is the most efficient and easiest way to tranfer my XML file from my desktop pc to pocker pc and vice-versa. this i have to do atleast 2 times a week.. after installing the application....
my application will be storing the data in a xml file, this file we will get and generate reports..so we need to copy / collect xml files from all the pocket pcs (about 30 in different locations of city) atleast 2 times a week...
-
Mar 9th, 2005, 09:26 AM
#15
Fanatic Member
Re: simple problem with mobile pc applicaiton
1. No idea, never needed to do it as i dont work with pocket pc's. Use other WinCE devices
2. If you write your own FTP class using the winnet.dll, you could transfer them over GPRS to s server location. You could also buy this implementation from www.sapphire-solutions.co.uk
Or if you want to transfer them to a laptop that you carry around with you, you could use the desktop.communications of the opennetcf library where you can write an application to copy files to/from the device
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Mar 10th, 2005, 06:19 AM
#16
Thread Starter
Member
Re: simple problem with mobile pc applicaiton
Another big problem !!!!!!!
my pocket pc, as normal, go to sleep if not in activity for some time, and then my applicaiton, even though working, is not displaying on my device screen and even the alert is not ringing... i want to make sure that my application displays on screen , etc everytime. how to do ?????
any programming options to make pocket pc not to go into sleep.
-
Mar 10th, 2005, 12:31 PM
#17
Frenzied Member
Re: simple problem with mobile pc applicaiton
How do you move the panels?
 Originally Posted by Shaggy Hiker
Frankly, you have very little space on a PDA, and that is how it will have to be.
If you feel that you have sufficient space for your controls and the keyboard, then that is good. If you don't have enough space, you will have to split the controls onto different "forms".
I put the forms bit in quotes because I still don't believe that using more than one form is a good idea. Instead, use one form with different panels on it. Any controls on the panel will move with the panel, so if you move a single panel into the screen area, all the controls will move with it. The organizational plan then is to swap panels in and out as needed. Set the left property to 0 on all panels, and the top porperty to 300, or so. Then when you want to show a panel, you simply need to change the top property to 0.
The advantage to this is that it is really fast. There is almost not time cost in swapping panels, whereas there is a potentially significant cost to loading forms (I think Strider posted another alternative that could work, as well).
In either case, have the panel or the form fill the screen, but put the controls above the area where the keyboard will go. If you don't have enough room for that, then you will need multiple screens.
-
Mar 11th, 2005, 04:23 AM
#18
Fanatic Member
Re: simple problem with mobile pc applicaiton
Panel1.Location = New Point(10, 10)
of instead of moving panels just hide and show them when needed
panel1.visible = True/False
panel1.bringtotop
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Mar 11th, 2005, 05:16 AM
#19
Frenzied Member
Re: simple problem with mobile pc applicaiton
Yeah...but it is abit annoying to keep shifting it out of the way when you are fiddling with the rest...
-
Mar 11th, 2005, 05:25 AM
#20
Fanatic Member
Re: simple problem with mobile pc applicaiton
i rarely use many panels in that way instead i user many forms....
i have found the best way to use forms is to have a controller class which creates an instance(Singleton Pattern) of each form while the splash screen is being displayed. then pass in a reference of this controller class to each form. now you will have no loading time assosicated with swapping forms.
if u are using the many panels just make the size of the form big in the dev environment and make all you controls and when you are happy how they work then place them on top of each other
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Mar 12th, 2005, 06:05 AM
#21
Thread Starter
Member
Re: simple problem with mobile pc applicaiton
no solution to my problem yet!!!!!!!!!!!!
i want to make my pocket pc never sleep and also the disable stop button.... to close the application, we MUST have to hard reset it..... any idea
-
Mar 24th, 2005, 01:52 AM
#22
Frenzied Member
Re: simple problem with mobile pc applicaiton
 Originally Posted by Strider
1. No idea, never needed to do it as i dont work with pocket pc's. Use other WinCE devices
2. If you write your own FTP class using the winnet.dll, you could transfer them over GPRS to s server location. You could also buy this implementation from www.sapphire-solutions.co.uk
Or if you want to transfer them to a laptop that you carry around with you, you could use the desktop.communications of the opennetcf library where you can write an application to copy files to/from the device
How do you use the opennetcf library???
i need to copy files from my pc to my pocket pc....
-
Mar 24th, 2005, 04:29 AM
#23
Fanatic Member
Re: simple problem with mobile pc applicaiton
there is a library (dll) that you can download here
this file will allow you do various things on the device from a desktop pc
download a sample here
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Mar 24th, 2005, 05:50 AM
#24
Frenzied Member
Re: simple problem with mobile pc applicaiton
Cheers,
got it working now...
I have just not realised how difficult working with a PPc is untill now...
-
Mar 24th, 2005, 05:55 AM
#25
Fanatic Member
Re: simple problem with mobile pc applicaiton
well its lucky you are not using EVB....what a *****
Barry
Visual Studio .NET 2008/Visual Studio .NET 2005/Visual Studio .NET 2003
.NET Framework 3.0 2.0 1.1/ASP.Net 3.0 2.0 1.1/Compact Framework 1.0
SQL Server 2005/2000/SQL Server CE 2.0
If you like, rate this post
Compact Framework for Beginners
-
Mar 9th, 2007, 08:13 PM
#26
Lively Member
Re: simple problem with mobile pc applicaiton
Strider - I used your code from Sept of 04, and it worked AWESOME!!! you saved me a bunch of time!
Thank you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|