C# Drag and Drop on PictureBox

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 15

  • @prabamike2842
    @prabamike2842 3 ปีที่แล้ว

    Allowdrop property is missing in picturebox? How to include this property

  • @kaox2424
    @kaox2424 6 ปีที่แล้ว +1

    Thank you, it help a lot.

    • @ProgramWithBalaji
      @ProgramWithBalaji  6 ปีที่แล้ว

      You are welcome! I'm glad. I was able to help you out :) If you haven't subscribed yet, please do so to help me grow my channel.

  • @sery152
    @sery152 5 ปีที่แล้ว

    THNAKS!

  • @jxxiong8719
    @jxxiong8719 6 ปีที่แล้ว

    If bitmap error say that bitmap is a class types cannot be used as an expression? How to fix it?

  • @jessieliset6478
    @jessieliset6478 6 ปีที่แล้ว

    Thank you thank you 😃😃😃

  • @ronny2768
    @ronny2768 5 ปีที่แล้ว

    Thank you 😊 goob help.

  • @denniscamacho9259
    @denniscamacho9259 5 ปีที่แล้ว

    Thank you :)

  • @somnathchaturvedi6388
    @somnathchaturvedi6388 7 ปีที่แล้ว

    can you explain how increase, decrease height and width after drag image in Picture Box. and Multiple Image in Single Image Box Or Panel etc.
    Thanks For Your Tutorial

    • @ProgramWithBalaji
      @ProgramWithBalaji  7 ปีที่แล้ว

      Whether you asking how to resize the size of picture box to the size of image once we drag and drop?

    • @somnathchaturvedi6388
      @somnathchaturvedi6388 7 ปีที่แล้ว

      after drag in Main Picture Box

    • @ProgramWithBalaji
      @ProgramWithBalaji  7 ปีที่แล้ว

      Before you enter the below code, set the size mode of pbMain to Normal by adding
      picMain.SizeMode = PictureBoxSizeMode.Normal;
      to the form load event handler.
      private void frmMain_Load(object sender, EventArgs e)
      {
      pbMain.AllowDrop = true;
      pbMain.SizeMode = PictureBoxSizeMode.Normal;
      }
      code to resize pbMain:
      ---------------------------------------------------
      private void pbMain_DragDrop(object sender, DragEventArgs e)
      {
      var bmp = (Bitmap)e.Data.GetData(DataFormats.Bitmap);
      pbMain.Image = bmp;
      pbMain.Height = bmp.Height;
      pbMain.Width = bmp.Width;
      }
      Once you execute the above code, the size of pbMain gets dynamically updated based on the size of image you drag and drop.
      Thank you for you kind viewing and posting your doubt to me.
      If you want any further video on any programming language ask me. If I know that I will try to make tutorial on that.

  • @sohahiio
    @sohahiio 6 ปีที่แล้ว

    10/10

    • @ProgramWithBalaji
      @ProgramWithBalaji  6 ปีที่แล้ว

      Thanks so much for watching! I'm glad. I was able to help you out :) If you haven't subscribed yet, please do so to help me grow my channel.