System.Drawing.RectangleF.Offset C# (CSharp) Method

Offset() public method

Adjusts the location of this rectangle by the specified amount.
public Offset ( PointF pos ) : void
pos PointF
return void
        public void Offset(PointF pos) => Offset(pos.X, pos.Y);

Same methods

RectangleF::Offset ( System pos ) : void
RectangleF::Offset ( float x, float y ) : void

Usage Example

        public override void LoadView()
        {
            View = new UIView();
            View.BackgroundColor = UIColor.LightGray;

            RectangleF f = new RectangleF(10,10,300, 44);
            UsernameTextField = new UITextField(f) {
                Placeholder = "Username",
                BorderStyle = UITextBorderStyle.RoundedRect,
                AutocapitalizationType = UITextAutocapitalizationType.None,
                AutocorrectionType = UITextAutocorrectionType.No
            };
            View.AddSubview(UsernameTextField);

            f.Offset(new PointF(0, f.Height + 10));
            PasswordTextField = new UITextField(f) {
                Placeholder = "Password",
                BorderStyle = UITextBorderStyle.RoundedRect,
                SecureTextEntry = true
            };
            View.AddSubview(PasswordTextField);

            f.Offset(new PointF(0, f.Height + 10));
            UIButton button = UIButton.FromType(UIButtonType.RoundedRect);
            button.SetTitle("Login", UIControlState.Normal);
            button.Frame = f;
            button.TouchUpInside += LoginHandler;
            View.AddSubview(button);
        }
All Usage Examples Of System.Drawing.RectangleF::Offset