Batista15 Posted June 4, 2009 at 10:44 AM Report #269836 Posted June 4, 2009 at 10:44 AM Boas, tenho o seguinte codigo: Private Sub Calcular() Dim ComprimentoBase As Integer = NumericUpDown1.Value Dim ComprimentoPecas As Integer = NumericUpDown2.Value Dim ComprimentoPecasss As Integer = NumericUpDown3.Value Dim conta1 As Integer = ComprimentoPecasss * ComprimentoPecas TextBox1.Text = conta1 Dim nr1 As Integer = NumericUpDown1.Value - conta1 TextBox3.Text = nr1 Dim nr2 As Integer = NumericUpDown1.Value - nr1 TextBox4.Text = nr2 Dim Divisoes As Double = ComprimentoBase / ComprimentoPecas Dim ComprimentoPorporcional As Integer = CInt((NumericUpDown2.Value * PB.Width) / nr2) Dim g As Graphics = PB.CreateGraphics g.Clear(Color.White) Dim ActPeca As Integer = 1 For i As Integer = 0 To PB.Width Step ComprimentoPorporcional g.DrawLine(Pens.Red, i, 0, i, PB.Height) If ActPeca <= Divisoes Then g.DrawString(ActPeca, New Font("Arial", 8, FontStyle.Regular, GraphicsUnit.Pixel), Brushes.RoyalBlue, i, 0) ActPeca += 1 Next End Sub E o que eu quero que o codigo faça e o seguinte, que divida a picturebox que é com a medida de 6500 por o numero de peças de uma medida, como por exemplo dividir uma regua de 10 metros em 2 bocados de 3 metros, nao sei se me fiz entender;) o codigo nao esta a dar erros, e até desenha, mas não é no tamanho de 6500
ribeiro55 Posted June 4, 2009 at 11:36 AM Report #269846 Posted June 4, 2009 at 11:36 AM Deves-me 5 minutos da minha hora de almoço 😛 Toma lá. Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips"
Batista15 Posted June 4, 2009 at 12:54 PM Author Report #269860 Posted June 4, 2009 at 12:54 PM Deves-me 5 minutos da minha hora de almoço 😛 Toma lá. Ok desculpa la 😞 Era mesmo isto, Obrigado! Vou agora perceber o código
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now