Click here to Skip to main content
15,918,041 members
Home / Discussions / Mobile
   

Mobile

 
QuestionMobile Based Management System - Info Required Pin
AmmarHaider15-Jan-09 15:16
AmmarHaider15-Jan-09 15:16 
AnswerRe: Mobile Based Management System - Info Required Pin
Joel Ivory Johnson16-Jan-09 4:45
professionalJoel Ivory Johnson16-Jan-09 4:45 
GeneralRe: Mobile Based Management System - Info Required Pin
AmmarHaider17-Jan-09 16:27
AmmarHaider17-Jan-09 16:27 
QuestionProgramming Cell Phone with J2ME on classic C-language Pin
Michael Monin14-Jan-09 10:12
Michael Monin14-Jan-09 10:12 
QuestionHow to use SQLMetalBuilder Tool Pin
vsaratkar13-Jan-09 4:05
vsaratkar13-Jan-09 4:05 
Questionmultiple instances of a .net cf 3.5 app [modified] Pin
kipelovets13-Jan-09 0:27
kipelovets13-Jan-09 0:27 
AnswerRe: multiple instances of a .net cf 3.5 app Pin
Joel Ivory Johnson16-Jan-09 4:47
professionalJoel Ivory Johnson16-Jan-09 4:47 
QuestionDpi-Aware experiments in V.S. 2005 Environment Pin
Hurricane300010-Jan-09 0:44
Hurricane300010-Jan-09 0:44 
Hi all,

I written the following code to make "DPI-Aware" the ImageSize property of an ImageList Control in my application (V.B. .Net C.F.2) in V.S. 2005 environment:

Dim RK As Microsoft.Win32.RegistryKey = _ Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Drivers\Display\GPE")
Dim LPX As String = CType(RK.GetValue("LogicalPixelsX"), String)
Dim LPY As String = CType(RK.GetValue("LogicalPixelsY"), String)
If LPX = 96 And LPY = 96 Then
Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16)
Else
Me.ImageList1.ImageSize = New System.Drawing.Size(32, 32)
End If

Well, I placed it in the Form1_Load event, and it works.

But with doubt if that place was the "rigth place", I tryed to place it in the "Form1.Designer.vb" code (because I think it is the "more appropriate" place).

I placed the first 3 line in the begin of code:

<global.microsoft.visualbasic.compilerservices.designergenerated()> _
Partial Public Class Form1
Inherits System.Windows.Forms.Form
Dim RK As Microsoft.Win32.RegistryKey = _ Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Drivers\Display\GPE")
Dim LPX As String = CType(RK.GetValue("LogicalPixelsX"), String)
Dim LPY As String = CType(RK.GetValue("LogicalPixelsY"), String)
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)

and the "If-Else" conditions immediately above the ImageList.Add property code:

If LPX = 96 And LPY = 96 Then
Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16)
Else
Me.ImageList1.ImageSize = New System.Drawing.Size(32, 32)
End If
Me.ImageList1.Images.Clear()
Me.ImageList1.Images.Add(CType(resources.GetObject("resource"), System.Drawing.Image))
Me.ImageList1.Images.Add(CType(resources.GetObject("resource1"), System.Drawing.Image))
Me.ImageList1.Images.Add(CType(resources.GetObject("resource2"), System.Drawing.Image))

Also if it's recomanded to not write code-lines directly in .Designer.vb code, the code works correctly in both emulator and device, BUT sometime (I not understood why and in witch circumstances), only the If-Else conditions lines above are deleted and replaced with the single line:

Me.ImageList1.ImageSize = New System.Drawing.Size(32, 32)

And then I must replace it again,

Of course, the problem is only in the debug phase, while after compilation there is no problem on device.

I know that this is a "not easy" question but I hope that someone can help me to clear my ideas about where it's more appropriate to place above code.

Thanks
AnswerRe: Dpi-Aware experiments in V.S. 2005 Environment Pin
Joel Ivory Johnson10-Jan-09 2:42
professionalJoel Ivory Johnson10-Jan-09 2:42 
GeneralRe: Dpi-Aware experiments in V.S. 2005 Environment Pin
Hurricane300010-Jan-09 7:58
Hurricane300010-Jan-09 7:58 
QuestionV.S. 2005 and Debug environment. Pin
Hurricane30009-Jan-09 8:44
Hurricane30009-Jan-09 8:44 
AnswerRe: V.S. 2005 and Debug environment. Pin
Joel Ivory Johnson9-Jan-09 17:41
professionalJoel Ivory Johnson9-Jan-09 17:41 
GeneralRe: V.S. 2005 and Debug environment. Pin
Hurricane300010-Jan-09 0:45
Hurricane300010-Jan-09 0:45 
NewsNokia Conference got postponed Pin
rakesh.rao8-Jan-09 0:59
rakesh.rao8-Jan-09 0:59 
QuestionHow to do Synchronization with back end Database using C#.net 2008 Pin
Chanuri7-Jan-09 21:55
Chanuri7-Jan-09 21:55 
AnswerRe: How to do Synchronization with back end Database using C#.net 2008 Pin
mrMagik380516-Jan-09 7:34
mrMagik380516-Jan-09 7:34 
QuestionPDA application Pin
trimandir prajapati7-Jan-09 18:41
trimandir prajapati7-Jan-09 18:41 
AnswerRe: PDA application Pin
Joel Ivory Johnson8-Jan-09 4:03
professionalJoel Ivory Johnson8-Jan-09 4:03 
QuestionMobile number is displayed Pin
Parasmani Swamy7-Jan-09 17:52
Parasmani Swamy7-Jan-09 17:52 
AnswerRe: Mobile number is displayed Pin
Lev Danielyan7-Jan-09 22:56
Lev Danielyan7-Jan-09 22:56 
GeneralRe: Mobile number is displayed Pin
Chaser9210-Jan-09 1:03
Chaser9210-Jan-09 1:03 
QuestionRedirect another process' output to a stream Pin
Chaser927-Jan-09 8:39
Chaser927-Jan-09 8:39 
AnswerRe: Redirect another process' output to a stream Pin
Randor 7-Jan-09 13:55
professional Randor 7-Jan-09 13:55 
GeneralRe: Redirect another process' output to a stream Pin
Chaser9210-Jan-09 1:56
Chaser9210-Jan-09 1:56 
GeneralRe: Redirect another process' output to a stream Pin
Randor 10-Jan-09 4:03
professional Randor 10-Jan-09 4:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.