Crossword

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
8 posts Page 1 of 1
Contributors
User avatar
jtlusco
VIP - Donator
VIP - Donator
Posts: 138
Joined: Mon Jul 12, 2010 11:28 pm

Crossword
jtlusco
I am trying to build a printable crossword app in vb.net
i want it to pretty much have a grid and to type the word and hit a button to place them along with the numbers and the clues will be placed at the bottome when you set the print so it will print the grid set right and the clues at the botom of the page i have been playing with this for about a month and so far all i have is a form with 625 text boxes and it loads slow. can anyone help me with sugestions exsamples and the like

I am useing visual studioes 2008 Visual Basic

sorry i forgot to add that lol
Last edited by jtlusco on Tue Jul 13, 2010 4:12 pm, edited 1 time in total.
Have you been scripted today
Image
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Re: Crossword
Agust1337
Just so you know, Visual Studio is many languages not one, so you'll have to say Visual Basic or VB or we could get confused and think your meaning C# or C++ or something.
Top-notch casual Dating
User avatar
jtlusco
VIP - Donator
VIP - Donator
Posts: 138
Joined: Mon Jul 12, 2010 11:28 pm

Re: Crossword
jtlusco
You are corect thats my fault im useing Visual Basic
Have you been scripted today
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Crossword
mandai
That's a bad idea using so many controls in a single form.
Try using an image in a picturebox instead:
Code: Select all
    Dim gfx As Graphics

    Dim blocksize As Integer = 32

    Dim numX As Integer = 6
    Dim numY As Integer = 6

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim bmp As Bitmap = New Bitmap(numX * blocksize + 1, numY * blocksize + 1) '+1 pixel for outer border
        gfx = Graphics.FromImage(bmp)

        For x As Integer = 0 To bmp.Width - 1 Step blocksize
            For y As Integer = 0 To bmp.Height - 1 Step blocksize
                gfx.DrawRectangle(Pens.Black, New Rectangle(x, y, blocksize, blocksize))
                'this will make our grid.
            Next
        Next
        PictureBox1.Image = bmp
    End Sub

    Sub drawLetters(ByVal xCol As Single, ByVal yCol As Single, ByVal text As String, ByVal horizontal As Boolean)

        xCol *= blocksize
        yCol *= blocksize
        Dim centering As Single = blocksize / 4
        For i As Integer = 0 To text.Length - 1
            gfx.DrawString(text(i).ToString(), Me.Font, Brushes.Black, xCol + centering, yCol + centering)
            If horizontal Then
                xCol += blocksize
            Else 'vertical
                yCol += blocksize
            End If

        Next
        PictureBox1.Refresh()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        drawLetters(1, 2, "TEST", True)

        drawLetters(2, 1, "TEST", False)

    End Sub
You do not have the required permissions to view the files attached to this post.
User avatar
jtlusco
VIP - Donator
VIP - Donator
Posts: 138
Joined: Mon Jul 12, 2010 11:28 pm

Re: Crossword
jtlusco
this is definitly a great palce for me to start i will work with this and try to exspand apon it to get exsactly what im looking for

i will upload a sample of the layout i am thginking about and see what you all think
Have you been scripted today
Image
User avatar
jtlusco
VIP - Donator
VIP - Donator
Posts: 138
Joined: Mon Jul 12, 2010 11:28 pm

Re: Crossword
jtlusco
ok here is a basic sample of what i am look to have the small text boxes are for the words to be gussed the larger ones are for the clues the other controls are self exsplanitory let me know what you think and if i can do what i am tryiong to do
with your cose in place
You do not have the required permissions to view the files attached to this post.
Have you been scripted today
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Crossword
mandai
I'd rather use a ListView in Details mode for the words list/clues part.
User avatar
jtlusco
VIP - Donator
VIP - Donator
Posts: 138
Joined: Mon Jul 12, 2010 11:28 pm

Re: Crossword
jtlusco
the list view wont work for what im trying because i dont want a set list of words and clues i want the person useing it to be able to type in what they want to use and cone up with it on there own
Have you been scripted today
Image
8 posts Page 1 of 1
Return to “Tutorial Requests”