We have created an Application called MyNotes with a rich text box, a menu with standard items, and a toolstrip.
We are going to write code so that the richtext box fills the lower part of the form. We want to do this at form load and also whenever the form is resized. We will create a general sub and call it from both form load and form resize:
Public Class Form1 Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize ResizeRichText() End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ResizeRichText() End Sub Private Sub ResizeRichText() RichTextBox1.Width = Me.Width RichTextBox1.Height = Me.Height - RichTextBox1.Location.Y End Sub End Class