🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.computer.workshop.live
Article #14

Re: How Can I add some functions in Visual Basic ?

#14
From: Ruo Fei Peng
Date: Tue, 02 Jun 1998 00:00
85 lines
3466 bytes

Raymond

I am using VB 3.0 and I think the way to build up menu bar should be same 
in VB5.

If you made the menu already, you should have no problem to code it. You 
just click on the iterm on the menu bar. The code edit window will appear 
and let you input the code. I enclose the details as follows just in case 
you need it because I am not quite sure how far you have reached. 

Create a form with a text box and use the Menu Design window to create a 
MyMenuEdit menu (can be any name),for each of the commands, 

set Caption = Cut, Copy and Paste; * 
set Name = MyMenuEditCut, MyMenuEditCopy and MyMenuEditPaste 

When these done you should see the menu bar. You might have this already.
Then click the each menu iterm place the following code to the correspondent 
iterm.


Sub MyMenuEditCut_Click ()	' Copy selected text to Clipboard.
	ClipBoard.SetText Screen.ActiveControl.SelText
	' Delete selected text.
	Screen.ActiveControl.SelText = ""
End Sub
'******************************************************************

Sub MyMenuEditCopy_Click ()	' Copy selected text to Clipboard.
	ClipBoard.SetText Screen.ActiveControl.SelText
End Sub
'******************************************************************

Sub MyMenuEditPaste_Click ()	' Place text from Clipboard into active control.
	Screen.ActiveControl.SelText = ClipBoard.GetText ()
End Sub


* You can also set it as C&ut, &Copy and &Paste, then you can active it 
by using alt+u, alt+c and alt+p from keyboard as well as by click mouse.

Hope this will give you some help.

Ruo


=========================================================================
            Ruo Fei Peng                       e-mail: r.peng@unsw.edu.au 
 . --_,\    School of Electrical Engineering   Phone : 61-2-93855394 
/       \   University of New South Wales      Fax   : 61-2-93855993 
\_.---._*   Sydney 2052 
       v    Australia 
=========================================================================





On Mon, 1 Jun 1998, Raymond Chow wrote:

>  
> 
> Hi group,
>     I am the beginner in Visual Basic 5. I am making a program and I
> want to insert the functions "Copy, Paste and Cut"
> I already make the menu bar, but I don't how to set the code of this
> part. Does someone can help me ??
>     Thanks your help !
>  
> 
> 
> 
Technical Details
Message-ID: <Pine.OSF.3.91.980602152126.12106A-100000@alpha400.ee.unsw.edu.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <35715B50.9800DE90@geocities.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10d683,b79d983bf7ba5756
X-Google-Attributes: gid10d683,public
X-Google-Thread: 101457,b79d983bf7ba5756
X-Google-Attributes: gid101457,public
From: Ruo Fei Peng <ruofp@alpha400.ee.unsw.edu.au>
Subject: Re: How Can I add some functions in Visual Basic ?
Date: 1998/06/02
Message-ID: <Pine.OSF.3.91.980602152126.12106A-100000@alpha400.ee.unsw.edu.au>
X-Deja-AN: 358700663
Content-Transfer-Encoding: QUOTED-PRINTABLE
References: <35715B50.9800DE90@geocities.com>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Organization: University of New South Wales
Newsgroups: alt.computer.workshop.live,aus.computers.ibm-pc