Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

- How Would I Comment / Uncomment Multiple Lines Like In Visual Basic???

- How would i comment / uncomment multiple lines like in visual basic???

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Comment Multiple Lines In Visual Studio.NET?
Hi. I need to comment out several lines at once. For example, I have this piece of code:


Can I achieve the following with one click?


Comment/Uncomment Buttons
Does anyone know of a shortcut for the "comment block" or "uncomment block" buttons on the VB6 toolbar? For that matter, does anyone know where all the shortcuts that the VB6 IDE supports?

Comment Multiple Lines
Is it possible to comment multiple lines without putting ' in front of them all?

Java lets you do this:

/* All
is commented */

Does VB have an equivalent?

Missing Comment/uncomment Block Buttons In Edit Menu
I have vb6 installed with sp5. My edit menu doesnt have the "comment/un-comment code block" buttons in the edit menu. However it DOES have them in the edit toolbar. Aren't they also supposed to be in the edit menu?

I dont like using the toolbars when I code. Is there anyway that I could tweak vb, or create an add-in for vb that would send the comment/un-comment options to my mouse's right-click menu?

How To Comment Out Multiple Lines Of Code?

I have almost 100 lines of code which I want to comment out, but using the single line commenting character ( ' ) for this is a little painful. Is there any way to comment these many lines of code in a better way? (Say at start and at the end). Because, in future I may use these lines of code, so again uncommenting it will be even more painful. I can do this in C, C++ and Java using /* and */. But how do I do it in VB? Can anyone help me on this? Thank you very much.


Edited by - sri1025 on 9/8/2005 8:54:28 AM

How Can We Comment Multiple Lines Of Code Simultaneously In VB6
How can we comment multiple lines of code simultaneously in VB6 like we do it in VB.Net?
"Work like you don't need the money, Love like you've never been hurt."

How To Insert A Note/comment In A Cell In Excel Using Visual Basic Codes
Hello friends,

Can you please help?

I like to insert a note/comment into a cell in Excel using VBA, but I just don't know how.

Thank you for any suggestion and help.


Anyone Know How To Do New Lines In Visual Basic

would like to know how to make visual basic display something a line below the current line.

here is the code and i will try and explain the situation

Private Sub CommandButton1_Click()

Sheets("Customer ID's").Select
Range("R2") = ID_Textbox.Value

Comment1 = "Your Details are as Follows"

Your_Details_Label = Comment1 & Range("S2").Text & Range("T2").Text & Range("U2").Text

End Sub

i would each different celll text to be displayed on a new line, without having to create multiple labels and have lots of different codes. just want each cell value being displayed on a line below the previous one



Comment Lines
Hello guys, I am new to here.... how read the comment lines from the .exe file ( Complied by vb)...

Comment Out Several Lines?
I'm unaware of the existence of some feature to comment out several lines at once. Is there such a thing?

How To Comment Bunch Of Lines ?
Putting a quote everyline is more work. Is there
some way I can comment bunch of lines in VB.

In C we use /* many lines */

Strange Comment Lines (MemberInfo)

I have this piece of code here which contains some strange comment lines:

Public Property Get BackColor() As OLE_COLOR

BackColor = UserControl.BackColor

End Property

Could you please tell me what...


...means and why it is commented?

Thank you in advance,
Sebastian Mares

Hi .. Shortcut 4 Comment The Lines Or Block In Vb
hi all
Is there any shortcut to comment a line or comment out the selected block without using mouse .. just like we use .. ctrl+A to select whole modules line .. and Ctrl+S to save the project ...

Please help me on this matter ...

ur friend ..
pawan jain

Multiple Interfaces In Visual Basic
I am developing COM (Automation) components in VC++. I wrote a VB client to use these components. Some of the APIs from these components return interface pointers. Typically in a VC++ client, the program would call a Release() on the interface pointers returned from APIs, after it has finished using the interface pointer(I use smart pointers, CComPtr, CCOMQIPtr etc. to take care of the Release()). How does this work in VB ?
For eg :

Dim obj1 as COMOBJ1
Dim obj2 as COMOBJ2

'Should CreateObj2() API do a AddRef() on obj2 'before returning it ? Should the VB client then
'call Release()(set to nothing) subsequently ?
'What is the rule here ?
set obj2 = obj1.CreateObj2()

'Finally release everything
set obj2 = nothing
set obj1 = nothing

My question is are there any specific reference counting rules to follow when developing COM components to be used across multiple types of clients.


Can U Please Help Me For Working With Multiple Forms In Visual Basic
Please help me for multiple forms
when i click
|Windows Xp | |Windows 95|

when he click on windows xp it goes to polo.exe

and when he click on windows 95 its go to bolo.exe

please urgent help

Visual Basic Multiple Password Creating
I need a help in Visual Basic 6.0. I am designing a project in VB6.0. I need a help in making a form that can allow the users of the program to create multiple password to access the program. I got an idea to make the password to be created and stored in MS Excel so that any time a User create and enter a password, the program will redirect to that MSEXCEL file to check the password. and if correct, the program will be opened or loaded. and the user can now have access to the program. but i did not know how to go about doing it. Please i need help.

Commenting A Block Of VBA Code Without Having To Comment Individual Lines
Hi everybody

Is there a way of commenting out a block of lines of VBA code without having to comment out each line individually as we can do in languages like C, Jave and the programming language SAS etc etc. like so (I think) :-


Block of code here


Best regards

Deepak Agarwal

Multiple Language Support Controls In Visual Basic
I wanna read,display multiple languages in a combobox,Flex Grid,List Box...etc by using the fonts.
Is there any third party cotrols which supports these.....?
Thanx in advance

Visual Basic To Send Lotus Notes Email's To Multiple Recipients

I want to be able to use VB to send an email, with attachments, to multiple recipients (say about 10 different people). The code I am using (below) works great except I can only manage to email one recipient. I can email an already set up group but I really want to be able build the list of recipients within the code.

I have searched many web sites and have found references such as this one:
    'Send the mail
    Call Doc.Send(False, "(Put the name(s) of the recipient(s) here)")

But no matter what combination I try (with commas between recipients, without commas, full email addresses, names from my address book, etc) I can not seem to send the mail to more than one person.

Does any one have a real working example they can show me.

Thanks, for any help.


Private Sub cmdSendMail_Click()

    Dim user As String, server As String, mailfile As String
    Dim doc As Object, rtobject As Object
    Dim session As Object, db As Object
    Dim item As Object, rtitem As Variant
    Dim Picture As Object
    Dim strBodyText As String
    Dim strSendTo As String
    Dim strSubject As String
    Dim i As Integer
    'An array to hold a list of pdf files to be attached to the email
    Dim strPDFList() As String
    strSendTo = txtTo.Text
    strSubject = txtSubject.Text
    strBodyText = txtBody.Text
    'Creates a notessession Object and provides mail details
    Set session = CreateObject("notes.notessession")
    user = session.UserName
    server = session.GETENVIRONMENTSTRING("MailServer", True)
    mailfile = session.GETENVIRONMENTSTRING("MailFile", True)
    Set db = session.GETDATABASE(server, mailfile)
    Set doc = db.CREATEDOCUMENT()
    doc.Form = "Memo"
    doc.sendto = strSendTo
    doc.Subject = strSubject
    Set rtitem = doc.CreateRichTextItem("body")
    Call rtitem.APPENDTEXT(strBodyText)
    Call rtitem.ADDNEWLINE(2)

    'Retrieves pdf file locations from an Access Database
    Set mrstAccess = mconAccess.Execute("SELECT PDF_Name FROM PDFs")
    'Attaches all pdf files specified to the email
    i = 1
    Do While Not mrstAccess.EOF
        ReDim Preserve strPDFList(i)
        strPDFList(i) = mrstAccess![PDF_Name]
        Set item = rtitem.EMBEDOBJECT(1454, "", strPDFList(i))
        i = i + 1
    'Send the mail
    'Call doc.Send(False, strSendTo)
    Call doc.Send(False)
    Set doc = Nothing

End Sub

Edited by - troys on 12/1/2003 9:40:48 PM

Visual SourceSafe Comment
I want to use a standard way to comment the check in's in Visual SourceSafe. Since the Comment field when you check in use text only you can't structure your comments the way you want.
Do you encountered this issue ?
How did you resolve it ?

Word And Visual Basic [ How Can I Get The Save As Window Through Visual Basic? ]
Hi, I made a small program in visual basic that with the use of

Dim oWord as new word.application
Dim oDoc as new word.document

fills a document with some data from the visual basic.
I want when those data are loaded in word the save or save as window to appear.
The command oDoc.saveAs saves the document without even asking for a filename.

What Can I do?

How Do I Run A Program I Made In Visual Basic On A Computer Without Visual Basic?
I created a program in Visual Basic and I was curious at what I needed to do to be able to install or use this program on a computer without Visual Basic. Any help would be great! Thanks in advance.

Extracting Visual Basic Source Code From Visual Basic EXE
hi everyone,

Well actually the problem in my case is that i had mad an EXE in VB6 around a week ago and had stored the EXE and th source code in two diferent folders. By mistake somebody ha deleted the source code folder. I wanted to make some changes i the EXE code and Now i have only the EXE folder to deal with.

Is there any method by which i can extract the Visual Basic cod from the VB EXE. Is there any application or software which ca help me in this? Do give me the hyperlink for downloading th EXE for the extraction if possible.

Please let me know at the earliest.

Thanks in advance.


Uncomment Codes
Dear friends,

apart from using the toolbar button to uncomment a selected block of code,
Is there any other methods to uncomment all the commented lines in the entire project ?


Edit Bar Does Not Have The Uncomment Code
My edit bar has the comment button but not the uncomment button

how do i get the uncomment button onto the edit bar?

Is Visual Basic Script As Ubset Of Visual Basic

Is visual basic script a subset of Visual Basic code?

Visual Basic Items Removed From Visual Basic.NET
A while ago (maybe up to a year) I had found a web page (probably a Microsoft MVP's home age) that had a list of about 100 things that were removed from Visual Basic in the transition to Visual Basic.NET. As it is, I would like to look at that again, but I can't seem to find it on my computer. Does anyone remember this page and/or have a copy of the link or the file that was on it. It has particular things like Debug.Print is no longer valid and MsgBox function is not supported. I've look on Microsoft's website and found a great deal of information about implementation difference, but I can't seem to locate this particular piece. If anyone could help I would appreciate it very much.

Thanks in Advnance

Nick August

Multiple Lines
I'm createing a very simple forum but am having trouble displaying any message that has been saved that users multiple lines. Below is an example of how it's saved and displayed in the databse but when I retreive and display it on my web page it's just one long string.

"How saved in database"

"How displayed on webpage"
This Message Users Multiple Lines.

I have the message field in my SQL db set to "mediumtext". Is this the correct type of field to use and if so why would it be displayed as one long string instead of how it's saved in the db?


Multiple Lines Of Text
i want to do something like this

Private Sub Command1_Click()
select case lbl1.caption
case = "whatever i have here"
lbl2.caption = "i need to show multiple lines
of text so it looks just like
this when it prints to the lbl2"
end select

End Sub

the problem i am having is that when i put the text in multiple lines like that all the lines except the top one turn red and i get a sytex error. is there a way to do this. the reason i want to do it this way is that i will be doing a lot of copy and paste for my label text and i am using as few labels as i can so im using "select case" to change them.

Getting Data From Multiple Lines
Hi, I have a .txt file with numbers in like the following:

How do I get that data out of the text file? I tried:

Private Sub cmdRead_Click()
Dim mapdata As Single

Open App.Path & "map.txt" For Input As #1

Input #1, nextline

Text1.Text = Text1.Text & nextline
End Sub

This just puts the first line into the textbox. How do I get all the lines?

BV6 List Box Multiple Lines
I'm trying to get some multiple lines working in a list box.
Like you can do in a text box, if the data imputted into the feild is longer that the width of the text box then it would carry onto the next line.

How do you do this on a list box. On a text box there is a option that is 'multiple line' and you just go true.

Also the 2 lines have to be connected as one, e.g. when you select either of the lines it is highlited as one option.

Any ideas.

Multiple Lines Of Text.
I need to know how to get multiple lines of text in lables snd message boxes. I have been using a different lable for each line of text, but there has to be a better way! If any one can help me I'd be greatful.

Multiple Lines In MSFlexGrid Row

i am populating the flexgrid with data. the column width is fixed and i dont want to change that. what i want is that if text in that column is grater than the column width then it should be displayed in the second line. i mean the rowheight should change. please help me with this..
waiting for replies.


Using Replace() With Multiple Lines
I am having a problem with replacing a chunk of strings with absolutely nothing. For example, i want to do the following:


and replace all instances of

with nothing. (vbNullString)

This is what i have:

Dim f as integer
Dim roffle2 as string
f = freefile
Open "C:Test1.txt" For Input As #f
Do Until EOF(f)
Input #f, roffle2
Text2.Text = Text2.Text + roffle2 + vbCrLf
Text3.Text = Text3.Text + Replace(Text1.Text, Text2.Text, vbNullString) + vbCrLf
Close #f
However, all that is replaced is the very first line.
Which would be, (referring to the examples) Rawr.
So, in Text3.Text i get a:

Can anyone help me?

If Statement On Multiple Lines
I have an If condition with a lot of 'or' operators and I want to split the expression on multiple lines, but somehow I'm getting a "Compile error: Expected: expression" on the first 'or' on the second line. Can anyone see what's wrong with my statement?

Private Function CheckResult() As Boolean

If Len(txtM2MIdMenlo.Text) > 0 Or Len(txtM2MIdAustin.Text) > 0 Or Len(txtP21Id70.Text) > 0 & Chr(13) & _
or Len(txtP21Id71.Text) > 0 or Len(txtP21Id72.Text) > 0 or Len(txtP21Id73.Text) > 0 & Chr(13) & _
or Len(txtP21Id74.Text) > 0 or Len(txtP21Id75.Text) > 0 or Len(txtP21Id76.Text) > 0 & Chr(13) & _
or Len(txtP21Id77.Text) > 0 or Len(txtP21Id78.Text) > 0 or Len(txtP21Id79.Text) > 0 & Chr(13) & _ Then
CheckResult = True
CheckResult = False
End If

End Function

Read Multiple Lines

If I have a textfile with, for an example, 3 different lines, how can I read that lines and put them in 3 different textboxes per line.


Multiple Lines In Clipboard???
Hi all!

I'm using this code to add something to the clipboard:

Clipboard.SetText "Signature Line 1"

. . . but I want to be able to add more than one line of text to the clipboard, ie:

Signature Line 1
Signature Line 2
Signature Line 3

Is there anyway of building in a line break to the Clipboard.SetText command?



Multiple Lines From A Txt File
hey ive got a bat file i want to loadin txt format, i can load single lines from it, well the bottom one. can any one help me load it all

heres my code


Private Sub cmdLoad_Click()
'Call AboutText
Dim temp As String, Message As Long
'this loads the about txtfile
ChDir App.Path
Open "c:dude.bat" For Input As #1
'While Not EOF(1)
'Line Input #1, temp
Text1.Text = Message '& vbCrLf & temp
Close #1
AboutText = Message
End Sub

cheers for the help

Multiple Text Lines
I want to send many lines of text into one text box. The text that is entered must include earlier entered fields that a user has entered and text i have programed into the box. is there any way in which the text can be displayed on new lines eace time a new field is inserted and each time my text is inserted?

Multiple Lines Of Text
ok how would i display tect on multiple lines useing vb code i already know tht you have to set the property to multiline=true but how would i display the text by useing code and not the property dialog on the side?

VB.Net Read Multiple Lines In Txt
Hey Guys,

Does anyone have a code on how to read a txt file with multiple lines?

Example of text file

this is my first line
this is the second line
this is the third line
this is the forth line

here is my code but it only displays the last line.


Imports System
Imports System.IO

Public Class Form1
Private Const FILE_NAME As String = "C: est ext.txt"
Public Sub Main()
If Not File.Exists(FILE_NAME) Then
TextBox1.text = "{0} does not exist." & FILE_NAME
End If
Dim sr As StreamReader = File.OpenText(FILE_NAME)
Dim input As String
input = sr.ReadLine()
While Not input Is Nothing
TextBox1.Text = input
input = sr.ReadLine()
End While
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
End Sub
End Class

Multiple Lines (list)
How do I input multiple lines in the list at one time? Like having a list but something generating mutliple linesmust like this :

Line 1
Line 2
Line 3
......... so on......

Well, later!

Edited by - SourceCode on 3/19/2006 4:18:25 PM

Printing Multiple Lines
I have a program which prints data from a database which works fine except one thing which is if the string Im printing is longer than the page it does not go to the next line and I can not figure out how to check the length of the string and then if need be break it down into smaller strings and print it over multiple lines. A push in the right direction please!!

Fwd: How To Disable Basic Functionality Of Back Space & Delete Key In Visual Basic
<html><div style='background-color:'><DIV>
<P><A href="" target=_top><IMG alt="Image by" src=" flamingtext_com_1057144048_20660.gif" border=0></A> <BR><BR>
<DIV>Try to use API's i am sure u will get ur problem</DIV></P>>Hi all
<DIV></DIV>> can any one tell how to disable back space & delete keys in perticular
<DIV></DIV>>text box.
<DIV></DIV>>thanks & regards,
<DIV></DIV>>Sridhar cs
<DIV></DIV>>*Manage Subscriptions:
<DIV></DIV>>*Leave Group:
<DIV></DIV>>*Questions: mailto: email@removed
<DIV></DIV>>*Terms of Use:
<DIV></DIV>>*Copyright (c) ITtoolbox and message author. No redistribution.
<DIV></DIV></div><br clear=all><hr>Add photos to your messages with <a href="">MSN 8. </a> Get 2 months FREE*.</html>

How To Disable Basic Functionality Of Back Space & Delete Key In Visual Basic
Hi all

can any one tell how to disable back space & delete keys in perticular
text box.

thanks & regards,
Sridhar cs

Code Change From Visual - Visual Studio 2005
I am working on a tuturial that i have for Visual ( for now )

I am working with Visual Studio 2005.

I have been working on a code to change the text color by the name put into
the text box.

Visual Basic .Net code.
Label2.ForeColor = Color.FromName(TextBox1.Text)

i get the error
Name 'Color' is not declared.

I was wondering if someone can show me how things would be in Visual Studio.

thank you

Writin Multiple Lines To Files
Hi ive been using :
Open "c:Msg02.dat" For Output As #1
Print #1, msg02
Close #1
to save a message and:
Open "c:Msg02.dat" For Input As #1
Input #1, msg02
Close #1
to open it again, this has worked fine up to now however i need to save a message that is approximately 8 lines long how do i do this

Text File With Multiple Lines Help.
I got a .txt file, with multiple lines. I don't want to confuse you guys, so i'll give you an easy example of what I'm looking for.

I have a text file with this in it:

Hello this is line 1
and this is 2 line 3

How would I read those lines one by one, or seperate them, becuase when I try to read it with input #filenum, variable , it only returns the first line in the .txt file...
I would appriciate some help :P ty

Copyright 2005-08, All rights reserved