title: Add an image to userForm with click event using vba
body: <p>I created a userForm to make possible to create a survey. It looks like that at the beginning:</p>
  
  <p><img src="https://i.stack.imgur.com/gz3us.jpg" alt="enter image description here"></p>
  
  <p>Clicking the cross that is next to "Add answer" you can add more rows as it can be seen in this other image:</p>
  
  <p><img src="https://i.stack.imgur.com/UNIzq.jpg" alt="enter image description here"></p>
  
  <p>The problem that I have is that I have to add those small arrows that are next to the checkboxes in the new rows. Those are to move the answers up and down if the user need to change the position of them. So I have to add code to it to move them. </p>
  
  <p>The creation of the elements that I need in each row is done in the following way:</p>
  
  <pre><code>Private Sub addAnswer_Click()
  Image5.top = Image5.top + 21
  CheckBox1.top = CheckBox1.top + 21
  CheckBox2.top = CheckBox2.top + 21
  Image7.height = Image7.height + 21
  Image3.top = Image3.top + 21
  Label1.top = Label1.top + 21
  Label4.top = Label4.top + 21
  Image2.top = Image2.top + 21
  tablet.top = tablet.top + 21
  chart.top = chart.top + 21
  Label8.top = Label8.top + 21
  Label9.top = Label9.top + 21
  LabelOrizontal.top = LabelOrizontal.top + 21
  LabelVertical.top = LabelVertical.top + 21
  LabelNet.top = LabelNet.top + 21
  LabelRound.top = LabelRound.top + 21
  LabelPoints.top = LabelPoints.top + 21
  Orizontal.top = Orizontal.top + 21
  Vertical.top = Vertical.top + 21
  Net.top = Net.top + 21
  Points.top = Points.top + 21
  Round.top = Round.top + 21
  ExcelBox.top = ExcelBox.top + 21
  
  OKButton.top = OKButton.top + 21
  CancelButton.top = CancelButton.top + 21
  'Me.MultiPage1.height = Me.MultiPage1.height + 21
  Image1.height = Image1.height + 21
  
  'height = 418 + 21 * (valueNum - 1)
  If valueNum = 2 Then
      With Me
          'This will create a vertical scrollbar
          .MultiPage1.Pages(0).ScrollBars = fmScrollBarsVertical
  
          'Change the values of 2 as Per your requirements
          '.ScrollHeight = .InsideHeight
          '.ScrollWidth = .InsideWidth * 9
      End With
  End If
  Me.MultiPage1.Pages(0).ScrollHeight = Me.MultiPage1.Pages(0).InsideHeight + 21 * (valueNum - 1)
  valueNum = valueNum + 1
  Set cCntrl = Me.MultiPage1.Pages(0).Controls.Add("Forms.TextBox.1", "textBox" &amp; valueNum, True)
      With cCntrl
          .width = 156
          .height = 18
          .top = 108 + (valueNum - 1) * 21
          .left = 48
          .TabIndex = tabInd
          .ZOrder (0)
      End With
  Set cCntrl1 = Me.MultiPage1.Pages(0).Controls.Add("Forms.TextBox.1", "AnsLabBox" &amp; valueNum, True)
      With cCntrl1
          .width = 144
          .height = 18
          .top = 108 + (valueNum - 1) * 21
          .left = 210
          .TabIndex = tabInd + 1
          .ZOrder (0)
      End With
  
  tabInd = tabInd + 3
  Set cCntrl3 = Me.MultiPage1.Pages(0).Controls.Add("Forms.CheckBox.1", "open" &amp; valueNum, True)
      With cCntrl3
          .left = 24
          .width = 11
          .height = 18
          .BackColor = "&amp;H8000000E"
          .top = 108 + (valueNum - 1) * 21
          .ZOrder (0)
      End With
  
  
  '''''''Here starts the important part for the question!!!
  Set cCntrl3 = Me.MultiPage1.Pages(0).Controls.Add("Forms.Image.1", "down" &amp; valueNum - 1, True)
      With cCntrl3
          .left = 12
          .width = 12
          .height = 6
          .BackColor = "&amp;H8000000E"
          .top = 116 + (valueNum - 2) * 21
          .Picture = LoadPicture(addInPath &amp; "\fixContent\triangleDown.jpg")
          .BorderStyle = fmBorderStyleNone
          .PictureSizeMode = fmPictureSizeModeStretch
          .ZOrder (0)
      End With
  With ActivePresentation.VBProject.VBComponents("surveyCreation").CodeModule
      X = .CountOfLines
      .InsertLines X + 1, "Private Sub down" &amp; valueNum - 1 &amp; "_Click()"
      .InsertLines X + 2, "goDown " &amp; valueNum - 1
      .InsertLines X + 3, "End Sub"
  End With
  Set cCntrl3 = Me.MultiPage1.Pages(0).Controls.Add("Forms.Image.1", "up" &amp; valueNum, True)
      With cCntrl3
          .left = 12
          .width = 12
          .height = 6
          .BackColor = "&amp;H8000000E"
          .top = 111 + (valueNum - 1) * 21
          .Picture = LoadPicture(addInPath &amp; "\fixContent\triangleUp.jpg")
          .BorderStyle = fmBorderStyleNone
          .PictureSizeMode = fmPictureSizeModeStretch
          .ZOrder (0)
      End With
  With ActivePresentation.VBProject.VBComponents("surveyCreation").CodeModule
      X = .CountOfLines
      .InsertLines X + 1, "Private Sub up" &amp; valueNum &amp; "_Click()"
      .InsertLines X + 2, "goUp " &amp; valueNum
      .InsertLines X + 3, "End Sub"
  End With
  Set cCntrl3 = Me.MultiPage1.Pages(0).Controls.Add("Forms.Image.1", "delete" &amp; valueNum, True)
      With cCntrl3
          .left = 480
          .width = 12
          .height = 12
          .BackColor = "&amp;H8000000E"
          .top = 110 + (valueNum - 1) * 21
          .Picture = LoadPicture(addInPath &amp; "\fixContent\cross.jpg")
          .BorderStyle = fmBorderStyleNone
          .PictureSizeMode = fmPictureSizeModeStretch
          .ZOrder (0)
      End With
  With ActivePresentation.VBProject.VBComponents("surveyCreation").CodeModule
      X = .CountOfLines
      .InsertLines X + 1, "Private Sub delete" &amp; valueNum &amp; "_Click()"
      .InsertLines X + 2, "deleteRow " &amp; valueNum
      .InsertLines X + 3, "End Sub"
  End With
  If Not comboVisi Then
      cCntrl2.Visible = False
  End If
  End Sub
  </code></pre>
  
  <p>So as you can see I create the elements and I also add some code (Click events) to the surveyCreation (witch is the userForm)</p>
  
  <p>The deleteRow, goUp and goDown methods are also defined. But it is never entering in the click events. The first click events (the ones that are made for the arrows that appears in the first image) are defined previously and they are working but not the ones that I define using the code that I created. So can I make them work?</p>