how to format a designer.vb file in correct format (shortcut method or shortcut key)

All replies

  • What do you mean by "correct form"? What is "correct form"? 
    Do you mean "indentation"? If so, menu [Tools]>[Options]>[Text Editor]>[Basic]>[Tabx]--change Indenting and Tab as you like.

    # You seem to paste code in Code Block. And code is automatically changed its format when it is pasted.
      So, I can hardly what is wrong/incorrect in Code Block.

    # Finally, don't paste whole text, i.e. omit middle part.

    Ashidacchi >>

    Thursday, March 08, 2018 8:26 AM
  • It's dependent on the keyboard theme e.g. if you elected to use VB keyboard theme then it's CTRL+K+D, meaning, while holding down CTRL, press K then  quickly without un-pressing CTRL press D.

    Note, since this file was created by a tool any changes you make will be lost when adding or removing a control and (have not verified this) possibly when changing a property value.

    It's prudent to stay out of the designer in regards to changing anything as you can end up with undesirable results if not careful.

    Last comment, those who are here all the time know what a designer file looks like so there is no need to show us :-)

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    • Proposed as answer by Ashidacchi Thursday, March 08, 2018 5:18 PM
    Thursday, March 08, 2018 5:09 PM
  • A designer.vb file is simply a straight textfile with vb code. 

    There is nothing magical about it. The only sligth difference is that it has the extension designer.vb


    Thursday, March 08, 2018 5:12 PM
  • I don't really get the question regarding shortcut method or key.

    The designer.vb file corresponds to the design view. If a control is added to a Windows Forms app for example in design view then the designer.vb file updates to show the control, its location and othe relevant information such as any properties not set to default settings I believe (also timers and other components that were not controls per se). All of that is performed by the designer engine I suppose if there is such a thing.

    On the other hand programmers in the past would write code in the, for example, Forms vb file that would implement all of the controls and pretty much everything from scratch such that the designer.vb file would not really contain much of anything since the Form in design view had no controls added to it.

    You make no mention of what you want to do by editing a designer.vb file or why that would be necessary. The correct format for a designer.vb file is the format it is in once you've finished designing a Form. Forms can be designed in many different ways since there are numerous controls and functionalities such as timers that can be added to a Form.

    La vida loca

    Saturday, March 10, 2018 11:05 AM