Where is richtextbox in vb6




















Raises the ContextMenuStripChanged event. Raises the ControlAdded event. Raises the ControlRemoved event. Raises the CreateControl method.

Raises the CursorChanged event. Raises the DockChanged event. Raises the DoubleClick event. Raises the DpiChangedAfterParent event. Raises the DpiChangedBeforeParent event. Raises the DragDrop event. Raises the DragEnter event.

Raises the DragLeave event. Raises the DragOver event. Raises the EnabledChanged event. Raises the Enter event. Raises the FontChanged event. Raises the ForeColorChanged event. Raises the GiveFeedback event. Raises the GotFocus event.

Raises the HandleCreated event. Raises the HandleDestroyed event. Raises the HelpRequested event. Raise the HideSelectionChanged event.

Raises the HScroll event. Raises the ImeChange event. Raises the ImeModeChanged event. Raises the Invalidated event. Raises the KeyDown event. Raises the KeyPress event.

Raises the KeyUp event. Raises the Layout event. Raises the Leave event. Raises the LinkClicked event. Raises the LocationChanged event. Raises the LostFocus event. Raises the MarginChanged event. Raises the ModifiedChanged event. Raises the MouseCaptureChanged event. Raises the MouseClick event. Raises the MouseDoubleClick event. Raises the MouseDown event. Raises the MouseEnter event. Raises the MouseHover event. Raises the MouseLeave event. Raises the MouseMove event.

Raises the MouseUp event. Raises the MouseWheel event. Raises the Move event. Raises the MultilineChanged event. Raises the Paint event. Raises the BackColorChanged event when the BackColor property value of the control's container changes. Raises the BackgroundImageChanged event when the BackgroundImage property value of the control's container changes.

Raises the BindingContextChanged event when the BindingContext property value of the control's container changes. Raises the ParentChanged event. Raises the EnabledChanged event when the Enabled property value of the control's container changes. Raises the FontChanged event when the Font property value of the control's container changes. Raises the ForeColorChanged event when the ForeColor property value of the control's container changes. Raises the VisibleChanged event when the Visible property value of the control's container changes.

Raises the PreviewKeyDown event. Raises the Protected event. Raises the QueryContinueDrag event. Raises the ReadOnlyChanged event. Raises the RegionChanged event. Raises the Resize event. Raises the RightToLeftChanged event. Raises the SelectionChanged event.

Raises the SizeChanged event. Raises the StyleChanged event. Raises the SystemColorsChanged event. Raises the TabIndexChanged event. Raises the TabStopChanged event. Raises the TextChanged event. Raises the Validated event. Raises the Validating event. Raises the VisibleChanged event. Raises the VScroll event.

Replaces the current selection in the text box with the contents of the Clipboard. Forces the control to invalidate its client area and immediately redraw itself and any child controls. Resets the BackColor property to its default value. Causes a control bound to the BindingSource to reread all the items in the list and refresh their displayed values.

Resets the Cursor property to its default value. Resets the Font property to its default value. Resets the ForeColor property to its default value. Resets the ImeMode property to its default value.

Resets the control to handle the MouseLeave event. Resets the RightToLeft property to its default value. Resets the Text property to its default value Empty. Converts the specified ContentAlignment to the appropriate ContentAlignment to support right-to-left text. Converts the specified HorizontalAlignment to the appropriate HorizontalAlignment to support right-to-left text.

Saves the contents of a RichTextBox control to an open data stream. Saves the contents of the RichTextBox to a specific type of file. Activates a child control. Optionally specifies the direction in the tab order to select the control from. Sets a value indicating how a control will behave when its AutoSize property is enabled. Sets the specified bounds of the TextBoxBase control.

Sets a specified ControlStyles flag to either true or false. Returns a string that represents the TextBoxBase control. Occurs when the value of the AcceptsTab property has changed. Occurs when the value of the BackColor property changes.

Occurs when the value of the BackgroundImage property changes. Occurs when the value of the BackgroundImageLayout property changes. This event is not relevant for this class. Occurs when the value of the BindingContext property changes. Occurs when the value of the BorderStyle property has changed. Occurs when the value of the CausesValidation property changes.

Occurs when the value of the ClientSize property changes. Occurs when the value of the ContextMenu property changes. Occurs when the value of the ContextMenuStrip property changes. Occurs when a new control is added to the Control. Occurs when a control is removed from the Control. Occurs when the value of the Cursor property changes. Occurs when the component is disposed by a call to the Dispose method.

Occurs when the value of the Dock property changes. Occurs when the user double-clicks the RichTextBox control. Occurs when the DPI setting for a control is changed programmatically after the DPI of its parent control or form has changed.

Occurs when the DPI setting for a control is changed programmatically before a DPI change event for its parent control or form has occurred. Occurs when the Enabled property value has changed.

Occurs when the Font property value changes. Occurs when the ForeColor property value changes. Occurs when the value of the HideSelection property has changed. Occurs when the ImeMode property has changed. Occurs when the Location property value has changed. Occurs when the value of the Modified property has changed. Occurs when the value of the Multiline property has changed.

Occurs when the Parent property value changes. Occurs before the KeyDown event when a key is pressed while focus is on this control. Occurs when AccessibleObject is providing help to accessibility applications.

Occurs when the value of the ReadOnly property has changed. Occurs when the value of the Region property changes. Occurs when the RightToLeft property value changes. Occurs when the Size property value changes. Occurs when the TabIndex property value changes.

Occurs when the TabStop property value changes. Occurs when the Text property value changes. Occurs when the Visible property value changes. Feedback will be sent to Microsoft: By pressing the submit button, your feedback will be used to improve Microsoft products and services.

Privacy policy. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Forms Assembly: System. Represents a Windows rich text box control. Note The TextBoxBase. Is this page helpful? Yes No. Any additional feedback? Skip Submit. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Explaining the semiconductor shortage, and how it might end. Does ES6 make JavaScript frameworks obsolete? Featured on Meta.

Now live: A fully responsive profile. Visit chat. Related 2. Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled. Accept all cookies Customize settings. We'll send a magic link to your inbox. Email Address. All Sign in options. Enter a Email Address. Choose your interests Get the latest news, expert insights and market research, sent straight to your inbox. Newsletter Topics Select minimum 1 topic. Anonymous Posted March 3, 0 Comments. Regards Veena.

RodStephens Posted March 4, 0 Comments. Sends formatted text in a RichTextBox control to a device for printing. SelPrint hdc. The SelPrint method syntax has these parts:. The device context of the device you plan to use to print the contents of the control. If text is selected in the RichTextBox control, the SelPrint method sends only the selected text to the target device.

If no text is selected, the entire contents of the RichTextBox are sent to the target device. Rather, it sends a copy of formatted text to a device which can print the text. For example, you can send the text to the Printer object using code as follows:. Notice that the hDC property of the Printer object is used to specify the device context argument of the SelPrint method. Note If you use the Printer object as the destination of the text from the RichTextBox control, you must first initialize the device context of the Printer object by printing something like a zero-length string.

The SelChange Event. Occurs when the current selection of text in the RichTextBox control has changed or the insertion point has moved. You can use the SelChange event to check the various properties that give information about the current selection such as SelBold so you can update buttons in a toolbar, for example. Sample Application. The sample application for this article uses the RichTextBox control to implement a WordPad-like text editor see the screen shot below :.

This article does not contain a "blow by blow" description of the code for the sample application, but much can be learned by downloading the sample application and working with it. The sample application incorporates many of the features of the RichTextBox discussed earlier in this article, and also incorporates the use of menus and controls discussed in the topics preceding this one Toolbar, CommonDialog, StatusBar.

Also, many of the concepts and techniques used for the File and Edit menu commands in the previous topic on building the basic text editor have been incorporated here. Development of this sample application was not as straightforward as I would have hoped. Most of the trouble stemmed from the fact that the RichTextBox has built-in capabilities for basic text editing such as support of keyboard shortcuts like Ctrl-X and Ctrl-V for cutting and pasting , causing conflicts when attempting to implement keyboard events and menu Edit commands such as keyboard shortcuts not working at all, "double pasting", etc.

Related to cutting and pasting is the Clipboard object, which I could not get to always "do the right thing" when a mixture of text and graphics was involved. These issues were resolved by using a custom Clipboard class in lieu of the Clipboard object, and by using the API technique of subclassing to intercept some of the keyboard shortcuts.

The sample application is a robust demo that shows you how to use many of the RichTextBox's features, as well as providing a "workout" with menus, the Toolbar, and the Common Dialog controls. Features that are not present in the sample application are advanced paragraph formatting and tab-setting.

If you were inclined to enhance this application, that would be a good place to start. In addition, you would have to come up with a way to display a ruler possible suggestions for the ruler include using a PictureBox in conjunction with labels or lines, or by finding a freeware custom control.

Download the project files for the sample application here. The RichTextBox Control The RichTextBox control allows the user to display, enter, and edit text while also providing more advanced formatting features than the conventional TextBox control. General Description The RichTextBox control provides a number of properties you can use to apply formatting to any portion of text within the control.

HideSelection Returns a Boolean value that determines whether selected text appears highlighted when the RTB loses focus. MaxLength Returns or sets a value Long indicating whether there is a maximum number of characters a RichTextBox control can hold and, if so, specifies the maximum number of characters.

RightMargin The RightMargin property is a Long value used to set the right most limit for text wrapping, centering, and indentation. ScrollBars Returns or sets a value indicating whether the RTB has horizontal or vertical scroll bars. SelAlignment Returns or sets a value that controls the alignment of the paragraphs in a RichTextBox control. SelAlignment Then ' Code to run when selection is mixed. ElseIf RichTextBox1. SelBold Then ' Code to run when selection is mixed.

End If SelBullet Returns or sets a value that determines if a paragraph in the RichTextBox control containing the current selection or insertion point has the bullet style. SelBullet Then ' Code to run when selection is mixed.

End If SelCharOffset Returns or sets a value that determines whether text in the RichTextBox control appears on the baseline normal , as a superscript above the baseline, or as a subscript below the baseline.

SelCharOffset Then ' Code to run when selection is mixed. SelFontName Returns or sets the font used to display the currently selected text or the character s immediately following the insertion point in the RichTextBox control.

SelFontSize Returns or sets a value that specifies the size of the font used to display text in a RichTextBox control. SelIndent, SelRightIndent, SelHangingIndent Returns or sets the margin settings for the paragraph s in a RichTextBox control that either contain the current selection or are added at the current insertion point. SelProtected Returns or sets a value which determines if the current selection is protected.

SelStart — returns or sets the starting point of text selected; indicates the position of the insertion point if no text is selected. SelText — returns or sets the string containing the currently selected text; consists of a zero-length string "" if no characters are selected.

When working with these properties: Setting SelLength less than 0 causes a run-time error.. Setting SelStart greater than the text length sets the property to the existing text length; changing SelStart changes the selection to an insertion point and sets SelLength to 0.

Setting SelText to a new value sets SelLength to 0 and replaces the selected text with the new string. SelRTF Returns or sets the text in.

Syntax object. Syntax: RichTextBox1. LoadFile pathname, filetype Where pathname is a string defining the path and filename of the file to load into the control and filetype is an integer or constant that specifies the type of file loaded.

SaveFile pathname, filetype Where pathname is a string defining the path and filename of the file to receive the contents of the control and filetype is an integer or constant that specifies the type of file to be saved. Find Searches the text in a RichTextBox control for a given string. Find string, start, end, options The Find method syntax has these parts: Part Description object Required.

The RTB control. Settings The setting for options can include: Constant Value Description rtfWholeWord 2 Determines if a match is based on a whole word or a fragment of a word. Remarks If the text searched for is found, the Find method highlights the specified text and returns the index of the first character highlighted.

This table describes the possible behaviors: Start End Search Behavior Specified Specified Searches from the specified start location to the specified end location. Specified Omitted Searches from the specified start location to the end of the text in the control.

Omitted Specified Searches from the current insertion point to the specified end location. Omitted Omitted Searches the current selection if text is selected or the entire contents of the control if no text is selected. GetLineFromChar charpos Where charpos is a long integer that specifies the index of the character whose line you want to identify. Span Selects text in a RichTextBox control based on a set of specified characters.

Settings The settings for forward are: Setting Description True Default Selects text from the current insertion point or the beginning of the current selection forward, toward the end of the text.

False Selects text from the current insertion point or the beginning of the current selection backward, toward the start of the text.



0コメント

  • 1000 / 1000