Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 4th, 2012, 04:35 AM
itrs itrs is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2009
Posts: 47 itrs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 h 11 m 31 sec
Reputation Power: 4
Text on picturebox

I have form in VB 2010 and want to display numerous textbox data on top of the picturebox before saving.

Using the following code, I can place the text from holeidtext on top of the picturebox but once I move off the field, it disappears.
I want ALL text boxes to display on the form as I change the data but remain on the form even when the form is resized.

I have done numerous web searches but am unable to find a solution. Any thoughts or web links would be appreciated.

Thanks

Code:
Public Class Form1

    Private pictureFileList As New List(Of String)
    Private picNumber As Integer = 0
    Private maxPicNumber As Integer = 0
    'Declaration


    Private Sub importButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles importButton.Click
        If importBrowser.ShowDialog() = DialogResult.OK Then
            importDirectoryText.Text = importBrowser.SelectedPath
            My.Settings.importDialog = importDirectoryText.Text
            My.Settings.Save()
        End If
    End Sub

    Private Sub exportButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exportButton.Click
        If exportBrowser.ShowDialog() = DialogResult.OK Then
            exportDirectoryText.Text = exportBrowser.SelectedPath
            My.Settings.exportDialog = exportDirectoryText.Text
            My.Settings.Save()
        End If
    End Sub

    Private Sub form1_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        importDirectoryText.Text = My.Settings.importDialog
        exportDirectoryText.Text = My.Settings.exportDialog
    End Sub

    Private Sub loadImageButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles loadImageButton.Click
        PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
        For Each pic As String In My.Computer.FileSystem.GetFiles(importDirectoryText.Text, FileIO.SearchOption.SearchTopLevelOnly, "*.jpg")
            pictureFileList.Add(pic)
            maxPicNumber = maxPicNumber + 1
        Next
        maxPicNumber = maxPicNumber - 1
        imageload()
    End Sub

    Private Sub backButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles backButton.Click
        picNumber = picNumber - 1
        If picNumber < 0 Then
            picNumber = maxPicNumber
        End If
        imageload()
    End Sub

    Private Sub forwardButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles forwardButton.Click
        picNumber = picNumber + 1
        If picNumber > maxPicNumber Then
            picNumber = 0
        End If
        imageload()
    End Sub

    Private Sub imageload()
        PictureBox1.Load(pictureFileList(picNumber))
    End Sub


    Private Sub holeidText_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles holeidText.TextChanged
        Dim g As Graphics = PictureBox1.CreateGraphics
        Dim x As Integer = 20
        Dim y As Integer = 30
        g.DrawString("HoleID : " + holeidText.Text, New Font("Arial", 12), Brushes.Black, x, y)
    End Sub


End Class

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Text on picturebox

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap