Talking about the function technology of Windows Notepad with VB

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

VB is a Visual Basic programming language to write computer programs need to use the computer programming language. Computer programming language is a bridge between human and computer "dialogue". Like human language, there are many computer programming languages. At present, the more widely used language has "C + +", "Pascal", "Basic" and so on. In many computer programming languages, Basic language is easiest to learn and use.

Basic is the English beginner ' s All Purpose symbolic instruction code abbreviation, meaning for beginners Common symbolic instruction codes, has always been the first language of programming design.

My understanding of VB is not deep, learning the language is not long, but also half a year, when in school, the school gave only six months to open the stop. In this half year time, the trend is enthusiastic, also made a few small software to come out: "Fluttering personal special notepad", "timing system", "Maple Ling Pay Settlement System ACC Edition"; Today I want to explain here is Notepad, this is we use the computer, we often use a tool. However, the function of such a small tool, and how to achieve it? Spadger, but not everyone can complete the Notepad to do some of the functions? I am a novice, the veteran don't get together, VB beginners can come to see:

First, let's look at the software interface:

  

  

Now look at the home page, we began a step-by-step function to explain it!

Font optimization:

How to invoke the Font Color panel: First Right-click the selection control in the panel and locate the Microsoft Common Dialog Control 6.0 controls inside and install it. Then add one of the controls to the workspace [customizable name], by: "Commondialog1.showcolor Text1.forecolor = Commondialog1.color", respectively, to invoke the color palette and text boxes, the text appended value;

How to invoke a font: "Commondialog1.flags = 3

Commondialog1.showfont "There are three fonts available at this time. You can judge. The judgment code is as follows:

If commondialog1.fontname <> "" Then

Text1.fontname = Commondialog1.fontname

End If

Text1.fontsize = Commondialog1.fontsize

Text1.fontbold = Commondialog1.fontbold

Text1.fontitalic = Commondialog1.fontitalic

How to control the font size by using the scroll bar:

Just add the scroll bar control, call this sentence: "text1.fontsize = Hscroll1.value" can be.

How the Find or Replace feature in the system is implemented:

Dim Inta as Integer

INTA = INSTR (1, Text1.Text, Text2.text)

Text1.setfocus

Text1.selstart = Inta-1

Text1.sellength = Len (Text2.text)

First, define a variable to store the selected data. And when you click "Query", Text1. Text to get focus; Text1.sellength get length;

This is the search, and the replacement? Since Text2. Text that you need to find, we just need to give another value to it, namely:

Text1.seltext = Text3.text

How do you call the contents of the private toolbar?

By using the shell statement, let's use the Super Terminal as a description, using the following statement to invoke:

Shell ("C:\Program files\windows NT\hypertrm.exe")

As described in "remote control" calls:

Shell ("Mstsc.exe")

There must be friends here who would say, why are they calling different? The above is the absolute path call, but the following is not; To illustrate, the following absolute path to call is also possible, but the system has given us such convenience, why do we not use it? As long as you can call the input process name in the system "run", Here, you can directly use the shell ("program name") of the way to pull out;

Two forms, how do we connect? as follows:

"Shengxiao21. Show "namely:" Form name. Show "

Limited to space, here only to say so much, see more content, please visit:

Http://hi.baidu.Com/huazhongxu

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.