How to use the API in vb to set text to transparent and accept cursor 20

Updated on technology 2024-03-15
15 answers
  1. Anonymous users2024-02-06

    TextBox does not show the cursor, which cannot be directly implemented in VB, and needs to call the API function.

    RichTextBox directly has a property that allows you to set the cursor to show or hide.

    As an input text box, the textbox usually needs to display the cursor, otherwise it would be inconvenient to insert or delete characters. I don't know why the landlord doesn't want to show the cursor? If you don't want to be modified, it's good to use label, at most it will make the appearance of label similar to textbox.

    If it's just for aesthetics, consider richtextbox.

  2. Anonymous users2024-02-05

    You can change the locked property of text to true, so that the user can't, and the background color is white, of course, you can also change the background color to any color.

    You can also use enable.,The background color doesn't turn gray.,If it changes.,You can adjust it to white through the attribute.。

  3. Anonymous users2024-02-04

    When the cursor moves to text, move the focus to the other widgets.

  4. Anonymous users2024-02-03

    apitextviewer declares a lot of errors.

    It is recommended that you go to the next apiguide, which is much easier to use than apitextviewer.

  5. Anonymous users2024-02-02

    vb moves the cursor to the text box, and just needs to let the text box get focus.

    To get focus, use the setfocus function.

    setfocus function: Set keyboard focus function prototype for the specified window: hwnd setfocus(hwnd hwnd).

    Parameter: The window pointer that hwnd receives keyboard input. If this parameter is null, keystrokes are ignored.

    Example: When there are more than 6 digits entered in text1, the focus will automatically shift to the text2 text box.

    private sub text1_change()if len( >6 then

    end sub

  6. Anonymous users2024-02-01

    The answers upstairs are too complicated, and the API is used, which is the easiest, and the actual verification passes!

    function abc(byval txt as textbox) as long

    dim s() as string, a as long, b as string

    a =if a > 0 then

    b = left(, a)

    s = split(b, vbcrlf)

    abc = len(s(ubound(s)))end if

    end function

    Remember to add a scrollbar to the text box, so that it is called:

    print abc(text1) 'text1 is the name of the text box control, which returns the position of the column where the cursor is located.

  7. Anonymous users2024-01-31

    In VB, the background color of the textbox cannot be changed to transparent.

    You can think differently and use label instead of textbox, and you can set it to transparent.

    Set the backstyle property of the label to 0-transparent

  8. Anonymous users2024-01-30

    = &h8000000f

    Actually, it's to set the background color of the textbox to the same color as the form.

    The backstyle attribute of label can be set to be transparent, but the textbox does not have this attribute.

  9. Anonymous users2024-01-29

    1. Set the backcolor of the textbox to the same color as the background.

    2. Introduce the package, which has transparent components inside.

  10. Anonymous users2024-01-28

    TextBox is difficult to do this, but it can be easily implemented with RichTextBox.

    Put an image1 and richtextbox1 on the form

    RichTextBox Location: Microsoft Rich Text Box Control

    option explicit

    private const gwl_exstyle = (-20)

    private declare function setwindowlong lib "user32" alias "setwindowlonga" (byval hwnd as long, byval nindex as long, byval dwnewlong as long) as long

    private declare function getwindowlong lib "user32" alias "getwindowlonga" (byval hwnd as long, byval nindex as long) as long

    private sub form_load()

    ==setwindowlong , gwl_exstyle, getwindowlong(, gwl_exstyle) or ws_ex_transparent

    end sub

  11. Anonymous users2024-01-27

    =textbox does not have the property of transparency.

  12. Anonymous users2024-01-26

    There are no transparent attributes, but the label can be set to the outside of the flash control by setting the label in front of the front.

  13. Anonymous users2024-01-25

    Insert the following line where you want it to be, and the cursor will be at the end = len(text1)-1 when you execute it

    If you want to select the full text, you can use the following command:

    In fact, the selstart attribute is the cursor position, and the sellenght attribute is the length of the Chinese book, and these two properties can be used together to operate the cursor.

  14. Anonymous users2024-01-24

    A property is a property of a control. The controls in the diagram are mainly text box controls, and the text property of the text box control refers to the text content displayed in the text box. In step 3, set the text property of all text box controls to empty, which means that all text boxes will have no text in their initial state when the program is opened.

  15. Anonymous users2024-01-23

    The text property of the text box represents the text content displayed in the text box, and making it empty has the same effect as if you manually deleted all the contents of the text box.

Related questions
6 answers2024-03-15

2, Then, save the file to your computer.

3. Select the notepad file, click "Rename" in the right-click menu, and click to open. >>>More

3 answers2024-03-15

The affiliate promotion API is a service content of the promotion API. The API service is a program interface open to the outside world of the network promotion system, and developers can directly interact with the server of the network alliance promotion platform through the API, obtain the standard network alliance promotion API services, and manage the network promotion account more scientifically and effectively. At present, the services launched by the promotion API include the search promotion API and the network alliance promotion API. >>>More

15 answers2024-03-15

It's similar to a calculator.,Numbers can be entered on the interface.,You can also use the keyboard to enter.,Later dedicated**!! >>>More

2 answers2024-03-15

The data source addnew itself is to add a line.,Of course, two lines appear when the landlord executes twice.,It should be placed on a line.,And then addnew's two parameters to two arrays on the line.,The usage is still used like this (field name,Content),It's just that the number of members of these two arrays is the same.,You can meet your requirements.,Try it.。

21 answers2024-03-15

There are a lot of ** on the Internet, search for it yourself.