when i m scrolling the picturebox inthat time rectangle is not visible

when i m scrolling the picturebox inthat time rectangle is not visible

Page 1 of 1

2 Replies - 2303 Views - Last Post: 12 March 2008 - 09:49 PM Rate Topic: -----

#1 swagatikasahoo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-March 08

when i m scrolling the picturebox inthat time rectangle is not visible

Post icon  Posted 12 March 2008 - 12:14 AM

Hi,

I am facing one problem can anybody help me?

i m working on vb.net2003.basically vb.net GDI+ platform.

problem is:-

when i m running the application ,it will display 4 line and one rectangle in picturebox.

problem is coming ,when i m scrolling the picturebox inthat time rectangle is not visible.
can anybody help me to solve this problem?

Add the Windows Form->addthe control Panel.->on the panel,addthe Picturebox->In panel properties,set the Autoscroll=true.
my code is :-
*************************************************

Public Class Form2
Inherits System.Windows.Forms.Form

+ Windows Form Designer generated code 

Dim eGraphics As Graphics
Dim xco As Single = 1024 / 2
Dim yco As Single = 130
Dim myco As Single
Dim i As Integer
Dim br As New SolidBrush(Color.DarkSlateGray)
Dim RecyCo, m_yCo As Single
Dim RecWidth As Single = 50
Dim RecHeight As Single = 20
Dim m_xCo As Single = 30

Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
Dim blackPen As New Pen(Color.White, 3)
Dim blackPen1 As New Pen(Color.Blue, 3)
eGraphics = e.Graphics
myco = 0
For i = 0 To 3
myco = 50 * 2 + myco
eGraphics.DrawLine(blackPen, 0, myco, 1023, myco)
Next
CreateRec(eGraphics)
End Sub
Public Sub CreateRec(ByVal eGraphics As Graphics)
m_yCo = 130 + m_yCo
eGraphics.FillRectangle(br, m_xCo, m_yCo, RecWidth, RecHeight)
End Sub


This post has been edited by PsychoCoder: 12 March 2008 - 07:34 AM


Is This A Good Question/Topic? 0
  • +

Replies To: when i m scrolling the picturebox inthat time rectangle is not visible

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: when i m scrolling the picturebox inthat time rectangle is not visible

Posted 12 March 2008 - 07:35 AM

I'm not quite sure I'm understanding your question. Can you explain it a little better for me please so I can try to help you :)
Was This Post Helpful? 0
  • +
  • -

#3 swagatikasahoo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 12-March 08

Re: when i m scrolling the picturebox inthat time rectangle is not visible

Posted 12 March 2008 - 09:49 PM

Hi,

I m again explain to u.i hav send the screenshot of my form.

Description:-
I hav added a windows form(Form2).In that form,I added the “Panel” control.
Over the “Panel” , I added the “Picturebox” control.Then goto the panel properties- select the “Auto Scrolling=true”.
In the runtime,it is creating the “Lines” and also creating the the Rectangle.
The no. of “Line” is 4 and no. of “Rectangle” is four.
It is working fine.
My problem is here:-

when I am scrolling in that time “Rectangle” are not visible. But I want to visible the rectangle when I am scrolling the picturebox.

Attached File(s)


This post has been edited by swagatikasahoo: 12 March 2008 - 09:51 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1