none
Big red X

    Question

  • Hi, I'm adminisitering an application written in vb.net 2005 and running on windows XP but displayed to the client through citrix. The client has recieved a big red x over on of the tabs. I am unable to duplicate it any ideas what would cause this?

    Thanks
    Friday, September 18, 2009 4:43 PM

Answers

  • Just as an add-on to Martin's remarks, for a quicker fix (requiring less learning in the process :-P ):

    If you do have the path to an image that should be displayed in your application hard-coded (for example:  "C:\SomeDirectory\SomeSubDir\Images\MyPicture.jpg") but you want to store that image in your application directory instead (especially important with network-served applications, since the Local Drive is usually C:\ but a network drive might be X:\ and we need to find that same file regardless of what drive-letter the server's storage area is mapped to), you can point that path back to the application's own native storage folder.

    So for example:

    Let's say that your application resides at C:\MyApp\

    And you want to store the GUI Images in a subfolder C:\MyApp\Images\

    When you're pointing imagelists or SomeControl.BackgroundImage properties at your images, make sure you're doing it in code (probably in the Form LOAD Event Handler) since it won't work if you put this text into the Properties Editor in Visual Studio Design Mode:

    System.Windows.Forms.Application.StartupPath & "\Images\" & MyPicture.jpg

    Make sure to remember that when Visual Basic returns a Path to a directory, you ALWAYS have to add a \ character at the end before you add a sub-directory or filename.

    Finally:

    If you use this line of code in various environment configurations, it will return different values (but that value will ALWAYS be accurate to the application directory itself).

    So if you install the software on C:\MyApp\ on the Server, and then run it from the Server, the line of code will return C:\MyApp\Images\MyPicture.jpg

    Or if you install the software on C:\MyApp\ on the Server, and then map a workstation drive at X:\ to C:\ on the Server, the code will return X:\MyApp\Images\MyPicture.jpg

    OR if you install the software on C:\MyApp\ on the Server, and then map a workstation drive at Y:\ to C:\MyApp\, the code will return Y:\Images\MyPicture.jpg

    I guess these last few lines are only academically interesting - the bottom line is that using this line of code to point to whatever application-resident images or files you want to work with will ALWAYS point back to the folder the application resides in at runtime.

    It never hurts to try. In a worst case scenario, you'll learn from it.
    Monday, September 21, 2009 4:48 PM

All replies

  • What tabs?

    A screenshot would be helpful.
    It never hurts to try. In a worst case scenario, you'll learn from it.
    Friday, September 18, 2009 4:55 PM
  • Is there supposed to be an image of some type on that tab? A big red X can indicate an image that could not be located.
    Friday, September 18, 2009 5:03 PM

  • a link to the screen shot. This should be a panel with some text boxes and a grid.
    http://s976.photobucket.com/albums/ae246/bulldog61/?action=view&current=BigRedX.jpg
    • Edited by Martin Xie - MSFT Monday, September 21, 2009 3:29 AM Modify HTML View code to display an illustration on your post.
    Friday, September 18, 2009 5:43 PM
  • Thank you All for your friendly help.


    Hi Mkraemer,

    Welcome to MSDN forums!

    Jinzai said "Is there supposed to be an image of some type on that tab? A big red X can indicate an image that could not be located."
    -> I fairly agree with Jinzai's assumption and conclusion. A big red X usually indicates that an image could not be located.

    You said "running on windows XP but displayed to the client through citrix. The client has recieved a big red x over on of the tabs."
    -> Based on my understanding, this application works fine on your development machine Windows XP, but not on client machines. Thus it's likely that an image (you use in your project) is either referenced in physical path or not published along with your project.


    e.g. You can consider referencing to an image in your project like this:

    l   Add image files to Project Resources

    l   Reference to Resource files in code using relative path

    l   Publish your application with Resource files

    Please check this thread for detailed instruction:

    http://social.msdn.microsoft.com/Forums/en/vbgeneral/thread/4b338468-7b59-45c3-a85f-21bb62e61edb/

     


    Best regards,

    Martin Xie


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, September 21, 2009 11:47 AM
  • Just as an add-on to Martin's remarks, for a quicker fix (requiring less learning in the process :-P ):

    If you do have the path to an image that should be displayed in your application hard-coded (for example:  "C:\SomeDirectory\SomeSubDir\Images\MyPicture.jpg") but you want to store that image in your application directory instead (especially important with network-served applications, since the Local Drive is usually C:\ but a network drive might be X:\ and we need to find that same file regardless of what drive-letter the server's storage area is mapped to), you can point that path back to the application's own native storage folder.

    So for example:

    Let's say that your application resides at C:\MyApp\

    And you want to store the GUI Images in a subfolder C:\MyApp\Images\

    When you're pointing imagelists or SomeControl.BackgroundImage properties at your images, make sure you're doing it in code (probably in the Form LOAD Event Handler) since it won't work if you put this text into the Properties Editor in Visual Studio Design Mode:

    System.Windows.Forms.Application.StartupPath & "\Images\" & MyPicture.jpg

    Make sure to remember that when Visual Basic returns a Path to a directory, you ALWAYS have to add a \ character at the end before you add a sub-directory or filename.

    Finally:

    If you use this line of code in various environment configurations, it will return different values (but that value will ALWAYS be accurate to the application directory itself).

    So if you install the software on C:\MyApp\ on the Server, and then run it from the Server, the line of code will return C:\MyApp\Images\MyPicture.jpg

    Or if you install the software on C:\MyApp\ on the Server, and then map a workstation drive at X:\ to C:\ on the Server, the code will return X:\MyApp\Images\MyPicture.jpg

    OR if you install the software on C:\MyApp\ on the Server, and then map a workstation drive at Y:\ to C:\MyApp\, the code will return Y:\Images\MyPicture.jpg

    I guess these last few lines are only academically interesting - the bottom line is that using this line of code to point to whatever application-resident images or files you want to work with will ALWAYS point back to the folder the application resides in at runtime.

    It never hurts to try. In a worst case scenario, you'll learn from it.
    Monday, September 21, 2009 4:48 PM