locked
The meaning of this RRS feed

  • Question

  • the following code is vb6 as you will all be coming to know and love my constant nagging about how to do my migration; frmXML.picXML are of the namespace system.windows.forms.picturebox and i am pretty sure that this is a command line to set the with of the picturebox picXML. I am just not at all sure how it does it.

    frmXML.picXML.Width(tabstyle = 0)


    If you're not living on the edge, you're taking up too much room
    Tuesday, July 21, 2009 12:49 PM

Answers

  • So it doesn't need to be indexed, so no tabstyle is needed??
    No, in VB 6.0 the value of Width represents a coordinate system measurement expressed in Twips. In Visual Basic .NET measurements are expressed in pixels.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Miller_a Tuesday, July 21, 2009 1:54 PM
    Tuesday, July 21, 2009 1:49 PM
  • Unless the editor is playing games with your code that syntax doesn't look to be valid if picXML is a PictureBox control. Width is a property that you assign a value to and is not indexed.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Miller_a Tuesday, July 21, 2009 1:43 PM
    Tuesday, July 21, 2009 1:16 PM
  • I'm at a loss as to how you can set a tabstyle on a PictureBox since no such property exists in VB.Net.  The way to set the Width of a PictureBox (which is what Paul told you the code is for) in VB.Net is this:

            frmXML.picXML.Width = 100   'set this number to whatever you need



    *** EDIT ***
    I'm beginning to think, from seeing some of the examples you ask about, that whoever wrote the VB6 code was trying to make sure they had a job for a while...since it seems to have only made sense to him/her.


    Doug

    NOTE: You can SEARCH ... then ask
    • Edited by _-Steve-_ Tuesday, July 21, 2009 1:40 PM
    • Marked as answer by Miller_a Tuesday, July 21, 2009 1:43 PM
    Tuesday, July 21, 2009 1:33 PM

All replies

  • Unless the editor is playing games with your code that syntax doesn't look to be valid if picXML is a PictureBox control. Width is a property that you assign a value to and is not indexed.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Miller_a Tuesday, July 21, 2009 1:43 PM
    Tuesday, July 21, 2009 1:16 PM
  • So it doesn't need to be indexed, so no tabstyle is needed??
    If you're not living on the edge, you're taking up too much room
    Tuesday, July 21, 2009 1:20 PM
  • I'm at a loss as to how you can set a tabstyle on a PictureBox since no such property exists in VB.Net.  The way to set the Width of a PictureBox (which is what Paul told you the code is for) in VB.Net is this:

            frmXML.picXML.Width = 100   'set this number to whatever you need



    *** EDIT ***
    I'm beginning to think, from seeing some of the examples you ask about, that whoever wrote the VB6 code was trying to make sure they had a job for a while...since it seems to have only made sense to him/her.


    Doug

    NOTE: You can SEARCH ... then ask
    • Edited by _-Steve-_ Tuesday, July 21, 2009 1:40 PM
    • Marked as answer by Miller_a Tuesday, July 21, 2009 1:43 PM
    Tuesday, July 21, 2009 1:33 PM
  • I had actually managed to guess to drop the tabstyle but i hadn't updated this post. Thank you for clarifying it though (it makes me feel more confident when i am told my guesses are actually right(ish) and the error dissapears for the right reasons not because there are too many errors for it to pick up the changed error.


    If you're not living on the edge, you're taking up too much room
    Tuesday, July 21, 2009 1:43 PM
  • So it doesn't need to be indexed, so no tabstyle is needed??
    No, in VB 6.0 the value of Width represents a coordinate system measurement expressed in Twips. In Visual Basic .NET measurements are expressed in pixels.
    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Marked as answer by Miller_a Tuesday, July 21, 2009 1:54 PM
    Tuesday, July 21, 2009 1:49 PM
  • Twips, that is the best thing i have read up on all day!!

    Thanks for the help and the explanations.
    If you're not living on the edge, you're taking up too much room
    Tuesday, July 21, 2009 1:53 PM
  • @ Doug

    I don't know enough about good programming practise to be able to comment on that.
    If you're not living on the edge, you're taking up too much room
    Tuesday, July 21, 2009 1:54 PM
  • PictureBox does not have a TabWidth property, and that property name makes little sense. (The width of a tab is a function of text, not an image.)

    What the OP is (probably) trying to ask about is TabIndex, which is a property of a control. It has to do with the order in which focus travels through a dialog, or other window. If you use the TAB key, the focus will travel from control to control in the order of the TabIndex property [eg 1, 2, 3, 4, 5, etc.]. It is simple a list of the order of controls for receiving focus.

    As far as the comment about the original programmer...some of the code you are seeing came from an attempt to upgrade using an automated tool, didn't it?

    The VB6 code I upgrade looks a mess, too...but that's because VB6 was easy enough to code with that everyone and his uncle wrote a VB6 app back in the day.

    MM_TEXT (logical units equals pixels) is the default mapping mode for any device context, and .NET allows you to change the units using the PageUnit property. So, VB6 does nothing about units by itself, mainly because there are readily available GDI functions (GetMapMode and SetMapMode) to do this with, and also changing mapping modes is somewhat advanced, and carries some other responsibilities that VB6 simply is not equipped to handle without programmer assistance.

    So, to answer your question [again], that property does not exist, and it is likely that the programmer intended to use the TabIndex property, which probably got edited by mistake to read what you have posted. TabIndex 0 would give that control focus first.
    Tuesday, July 21, 2009 2:57 PM