Results 1 to 3 of 3

Thread: [RESOLVED] converting type int to string continuous error???

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Location
    England
    Posts
    283

    Resolved [RESOLVED] converting type int to string continuous error???

    i have the following code so the caption of the form shows the width of the device. But it keeps on with the error "cannot convert type int to string".

    PresentParameters presParams = new PresentParameters();

    Utility.DisplaySwitchingToRefWarning(sampleFramework,(string)presParams.DeviceWindow.Width);

    i have tried adding ".tostring" on the end that won't work either...

    Any thoughts

    Cheers

    GTJ

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: converting type int to string continuous error???

    If it is an int this should work

    Code:
    Utility.DisplaySwitchingToRefWarning(
      sampleFramework, 
      presParams.DeviceWindow.Width.ToString()
    );
    failing that can you post the exact error message?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2005
    Location
    England
    Posts
    283

    Re: converting type int to string continuous error???

    cheers for replyin so quick.

    However i have found another way round it by gettin the width value from e.device...

    i think that the presParams width value was not an int, so that is y it caused an error.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width