CornMaster 08-24-2000, 08:53 PM Do any of you edit vb in notepad??? When I make a change that I want to post to many forms I just copy the code from notepad and paste it to the other forms. I find this faster than creating textboxes and renaming and etc....
Anyone else do this?
CornEmpire Board Administrator
<A HREF="http://www.geocities.com/thecornmaster/" target="_new">http://www.geocities.com/thecornmaster/</A>
amram71 08-24-2000, 08:56 PM I could do this, but i think using the IDE is a lot organized and easier
I've done this to save myself a LOT of time. I had a program which had a HUGE menu item list (one particular menu item with several beneath it), with certain events associated with each sub-menu. I needed to then get this same menu into a different program that I had (two quite similar programs but also very unique) Using copy and paste, I could do it in notepad very quickly and make sure that I used the exact same code in both programs. If I wanted to build the menu items in VB and then try to either type or copy the code, it would have taken me a LOT longer.
Basically, I didn't want to reinvent the wheel and notepad seemed the fastest way to copy my code.
cbrewer 08-25-2000, 02:45 PM I dont understand the question here. If you are talking about copying code, where does creating a new text box come in at? Copying code is a matter of highlighting it and Cntrl-C, then open each of the other forms and Cntrl-V.
If you need to copy a textbox, or any control, select the control in design view, Cntrl-C, move to the other form and Cntrl-V. Copying controls does not copy the code, nor does copying the code copy the control.
Copying code from a form, pasting to Notepad, then copying from Notepad and pasting to a form only adds an extra step.
I do however, keep code (subs and functions) which I know I will use in the future stashed in a text file for them days when I can't remember exactly how to do something. That works well, all I normally need to do is edit the variable names. That is much easier than looking through MSDN.
Chuck
SeiferTim 08-25-2000, 04:03 PM Using notepad is also a nifty way to change the value of your TagIndex is version 5.0 and below...
-Seifer Tim
Visit my Web-Site: http://solenoid.50megs.com
CornMaster 08-25-2000, 10:46 PM What I meant cbrewer is this. I'll put a little code from a program I'm working in notepad. And I copied the menu as well as a textbox. This made it quicker than recreating all of that for the 8 forms I was going to put it on. You just have to know where to place the code.
<font color=blue> Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnucalculator
Caption = "&Calculator"
Shortcut = ^C
End
Begin VB.Menu mnuselectnew
Caption = "&Main Menu"
Shortcut = ^M
End
Begin VB.Menu mnuQuit
Caption = "&Quit"
Shortcut = ^Q
End
End
Begin VB.Menu mnuInfo
Caption = "&Info"
Begin VB.Menu mnuHistory
Caption = "&History/Plans/Other Docs"
Shortcut = ^H
End
End
End</font color=blue>
and the textbox code
<font color=red> Begin VB.TextBox calctext
Height = 285
Left = 240
TabIndex = 17
Top = 2640
Visible = 0 'False
Width = 255
End</font color=red>
and the controls
<font color=green>Private Sub Form_Load()
iniPath$ = App.Path + "cccfg.ini"
calctext = GetFromINI("calc", "program", iniPath$)
End Sub
Private Sub mnucalculator_Click()
Dim sFile$
sFile = calctext.Text
sFile = Replace(sFile, Chr(34), "")
sFile = Chr(34) & sFile & Chr(34)
Shell sFile
End Sub</font color=green>
You can clearly see why coping this code to 8 notepad files was easier than recreating the menus for 8 forms, textbox renaming and properties for 8 forms and the functions of these new components.
CornEmpire Board Administrator
<A HREF="http://www.geocities.com/thecornmaster/" target="_new">http://www.geocities.com/thecornmaster/</A>
BillSoo 08-28-2000, 12:53 PM My main use for notepad code is when I change controls. For instance, when I change from a grid to msflexgrid. It's a lot easier to do a search and replace operation in notepad than individually delete and replace each control (plus properties) in the IDE.
I also use it sometimes when I want to know what properties of controls have changed from their defaults.
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
Valkyrie 08-28-2000, 02:14 PM Wow! This topic was so interesting and helpful I have copied it into notepad so I can paste it into Word! /images/icons/crazy.gif
Is the forum that light on interesting topics that we have to resort to finding a lot to say about Notepad and copy/paste? /images/icons/shocked.gif
(Personally I just open two copies of VB and copy/paste from one to the other) /images/icons/smile.gif
Cheers!
Quote of the moment....
"When you cease to make a contribution you begin to die"
NoahBody 08-28-2000, 06:37 PM Alright,
Here's my two cents:
I use Qedit (for DOS) a lot. It has some really nice text editing features unavailable in the IDE. For instance, vertical copy and paste or selecting a vertical block and filling it with a character. Notepad's Search-and-replace is MUCH better then the IDE's.
->Noah
anhmytran 09-01-2000, 01:06 AM CornMaster is correct copying the design section of a form using Notepad, especially the menu design section. When you create a menu, you should use the Menu Editor that takes more time than copying via Notepad.
If you want to copy the source code, the best way is not the Notepad option. You can copy and paste from form to form or to standar module or class module, from any VB source code in the network without opening an extra VB environment. Just simply add the existing form (or modules) into the current project, copy code from it, then Remove it by the Project menu. VB IDE has Find, and Replace as well as indentation, and coloring text that is better than Notepad. You can either use Ctrl+C/Ctrl+V or Ctrl+Insert/Shift+Insert for copy and paste. Why bother to use Notepad?
If you copy and reuse a source code, why don't you make a DLL, rather than copying it and paste it over and over with the risk of having errors? In this case, why bother copy?
AnhMy_Tran
CornMaster 09-01-2000, 09:09 AM "If you copy and reuse a source code, why don't you make a DLL, rather than copying it and paste it over and over with the risk of having errors? In this case, why bother copy?"
Because I have no idea how to do this!?!?!?
CornEmpire Board Administrator
<A HREF="http://www.geocities.com/thecornmaster/" target="_new">http://www.geocities.com/thecornmaster/</A>
anhmytran 09-01-2000, 09:57 AM VB IDE has another advantage over Notepad that developer may use F2 key at a Variable name or Function name or Sub name. You can use the combination of Shift+F2 as well. Using this feature, you can find the original names throughout the entire project at one stroke, no matter how complex your project is with hundreds of forms, standard modules and classes. That is the reason we use IDE rather than notepad.
It is very easy creating DLL for reuse.
Create a brand new project: ActiveX DLL.
You can use forms or remove all forms. Click the Project Menu, then Add Standard Modules or Class Modules as you like by copying and pasting the source code you intend to reuse in specific projects or just simply all projects.
In the Property of the Project you give it a Description that may be as the same name as the project or different.
Click File Menu and select the choice Create DLL file.
VB IDE then creates your DLL file and registers it in the current machine.
In order to use the DLL in any project (not itself, of course) click Project Menu, select Reference, and check the check box that has the description of the DLL project. Then in the code, you may code the names of the Classes or the names of the Modules in your DLL project. Immediately after the names, type a period, and VB IDE displays all properties, methods and events of the classes you are using. If it is a name of a module, type an open parenthesis, VB IDE displays the list of the parameters required or optional for the functions.
AnhMy_Tran
CornMaster 09-01-2000, 08:49 PM I'll give it a try anhmytran.
Thanks
CornEmpire Board Administrator
<A HREF="http://www.geocities.com/thecornmaster/" target="_new">http://www.geocities.com/thecornmaster/</A>
Flamelord 09-28-2000, 02:40 PM What about the template add-in? All you would have to do is create a form with the menu and code in the template directory. Then open each form and select Add menu... Presto! It adds the menu and all the code behind it... This is really good in a corporate environment. We changed the path of the templates (Tools...Options) to a network folder and never have to create standard items again.
zoldy 09-28-2000, 04:35 PM Ok my two cents....... the only thing I knew about was copy and paste .... and now thruough reading this topic I know many better and more efficient ways ...... thanks to everyone ...
:) ZOLDY :)
|