Convert HTML/Javascript html file to VB code

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 5228 Views - Last Post: 20 March 2012 - 11:06 AM Rate Topic: -----

#1 lgice348  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 13-March 12

Convert HTML/Javascript html file to VB code

Posted 13 March 2012 - 12:47 PM

Ok so i have this template that i created in javascript but upgrading to IE9 or higher makes the template not work so im going to make something in VB6 to make things better. on my template i have now i have a couple of forms and then radio buttons on the bottom and when you select a radio button at the bottom more forms display below the currnet forms that are already displayed.
and it expands the height of the window and im trying to figure out a good way to do this is VB6? Basically the attached file is what im trying to duplicate in vb

Or if there is a good way to convert this HTML file to vb that would be great(see attached) I could possibly pay for help on this

Attached File(s)


This post has been edited by Atli: 13 March 2012 - 01:28 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Convert HTML/Javascript html file to VB code

#2 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Convert HTML/Javascript html file to VB code

Posted 13 March 2012 - 03:21 PM

Who will be using your application? Are you talking about making a VB6 program that runs on the internet?
Was This Post Helpful? 0
  • +
  • -

#3 lgice348  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 13-March 12

Re: Convert HTML/Javascript html file to VB code

Posted 13 March 2012 - 03:24 PM

no this program will be standalone and only be used on the computer locally, it web based right now because the person that made it only knew how to make it that way and im trying to get away from having to use internet explorer and actually have an executable to use from the desktop
Was This Post Helpful? 0
  • +
  • -

#4 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Convert HTML/Javascript html file to VB code

Posted 14 March 2012 - 12:18 PM

Ok, that's fine. I would first experiment with creating a standard exe in VB. Put "option buttons" (radio buttons, same thing) on it. Now, I would NOT use option buttons to display a form. Use command buttons. Option buttons are for selecting one of several options, and a better way to do it is with a dropdown listbox. (combo box in vb, with style property set to 3).

To get you started, start a standard exe. put a command button on your form. Add a second form to the project. double click the command button. In the resulting code window, add this line:
Form2.Show

Run your program.

Start there, play around, see what you can do. Ask questions when you run into difficulties.
Was This Post Helpful? 0
  • +
  • -

#5 lgice348  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 13-March 12

Re: Convert HTML/Javascript html file to VB code

Posted 19 March 2012 - 07:19 AM

Ok So this is what i have done so far i have the form2.show function working but i made it so the form loads into a frame(not sure if that was smart or not just trying to get it to load is a certian spot on my main form. but when the form loads its loads in a funky spot in the frame and i want it to load in the top left corner of the frame. I also have fully created the clear function for everything only thing is im just using the form2.hide to remove the form2 from the frame not sure if that is a good way of doing that as well.

Also I have the clipboard.settext function working but it only works for 1 textbox if i duplicate that such as adding that line and chaning the textbox name to the next one it doesnt copy both boxes but just one and not sure how to go about fixing that.

I am still editing more on it to try and work things around but i have got stuck :(
i can post code if you would like but i figured since there is alot already i didnt want to make this post super long
Was This Post Helpful? 0
  • +
  • -

#6 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Convert HTML/Javascript html file to VB code

Posted 19 March 2012 - 08:10 AM

It might be better if you post the code, as I'm struggling understanding what you've done with the form (displaying the form in a frame).
Was This Post Helpful? 0
  • +
  • -

#7 lgice348  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 13-March 12

Re: Convert HTML/Javascript html file to VB code

Posted 19 March 2012 - 08:30 AM

:) sorry for confusing you :) her eis the code

Option Explicit
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long


Private Sub btnClear_Click()

    If btnClear Then
btnNavilink.Visible = False
    End If
    If btnClear Then
btnBAS.Visible = False
    End If
    If btnClear Then
btnPACE.Visible = False
    End If
    If btnClear Then
btnOmar.Visible = False
    End If
    If btnClear Then
btnWorkstation.Visible = False
    End If

    If Check1 Then
frmEmail.Visible = False
    End If
        Check1.Value = 0
    If Check2 Then
frmLocation.Visible = False
    End If
        Check2.Value = 0
    If Check3 Then
frmComputerName.Visible = False
    End If
        Check3.Value = 0
        
frmSummary.Text = ""
frmLan.Text = ""
frmContact.Text = ""
cmbSev.Text = ""
cmbLocation.Text = ""
frmDesc.Text = ""
frmEmail.Text = ""
frmLocation.Text = ""
frmComputerName.Text = ""
frmPWreset.Hide
frmPWreset.frmPWreset1.Text = ""
frmPWreset.frmPWreset2.Text = ""

End Sub

Private Sub btncopy_Click()

Clipboard.Clear
Clipboard.SetText frmSummary.Text
'Clipboard.SetText frmDesc.Text
'Clipboard.SetText frmLan.Text
'Clipboard.SetText frmContact.Text
'Clipboard.SetText cmbSev.Text
'Clipboard.SetText cmbLocation.Text

    'If Check1 = True Then
'Clipboard.SetText frmEmail.Text
    'End If

MsgBox ("Template copied! Paste (CTRL+V or right click and paste) into long description of Service Center ticket")

End Sub

Private Sub btnDeskside_Click()

    If btnDeskside Then
btnNavilink.Visible = True = btnNavilink.Visible = False
    End If
    If btnDeskside Then
btnBAS.Visible = True = btnBAS.Visible = False
    End If
    If btnDeskside Then
btnPACE.Visible = True = btnPACE.Visible = False
    End If
    If btnDeskside Then
btnOmar.Visible = True = btnOmar.Visible = False
    End If
    If btnDeskside Then
btnWorkstation.Visible = True = btnWorkstation.Visible = False
    End If

End Sub

Private Sub btnEnd_Click()

    If btnEnd Then
btnNavilink.Visible = False
    End If
    If btnEnd Then
btnBAS.Visible = False
    End If
    If btnEnd Then
btnPACE.Visible = False
    End If
    If btnEnd Then
btnOmar.Visible = False
    End If
    If btnEnd Then
btnWorkstation.Visible = False
    End If
    
frmPWreset.Hide

End Sub

Private Sub btnPw_Click()

frmPWreset.Show
SetParent frmPWreset.hWnd, frmTemp.hWnd

End Sub

Private Sub Check1_Click()

    If Check1 Then
frmEmail.Visible = True
    Else
frmEmail.Visible = False
    End If

End Sub

Private Sub Check2_Click()

    If Check2 Then
frmLocation.Visible = True
    Else
frmLocation.Visible = False
    End If

End Sub

Private Sub Check3_Click()

    If Check3 Then
frmComputerName.Visible = True
    Else
frmComputerName.Visible = False
    End If

End Sub

Was This Post Helpful? 0
  • +
  • -

#8 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Convert HTML/Javascript html file to VB code

Posted 19 March 2012 - 08:41 AM

Sorry, didn't help me much in understanding how you've done the forms (maybe a screen shot would help?).

Have you set this up as an MDI type interface or maybe I'm missing something here? Maybe I'll leave this one for Bob to pick up as he obviously has a better understanding of what you're trying to do.

This post has been edited by maj3091: 19 March 2012 - 08:49 AM

Was This Post Helpful? 0
  • +
  • -

#9 lgice348  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 13-March 12

Re: Convert HTML/Javascript html file to VB code

Posted 19 March 2012 - 08:57 AM

What im trying to do is basically make the template that i have in .html (attached on 1st post) in a vb6 .exe that i can run outside of IE. what ive tried doing here is 1st create my main form which is frmTemplate and when ever i have a user click on the PW Reset button frmPWreset loads into the frmTemp frame.

P.S. I uploaded a SS :)

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#10 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Convert HTML/Javascript html file to VB code

Posted 19 March 2012 - 09:13 AM

Don't take this the wrong way, but I never download attachments from here, just to be on the safe side.

Do you really need to use separate forms? If not, you could use frames as containers to hold the relevant information for each option and just display the relevant one accordingly?
Was This Post Helpful? 0
  • +
  • -

#11 lgice348  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 13-March 12

Re: Convert HTML/Javascript html file to VB code

Posted 19 March 2012 - 09:34 AM

no i dont have to use forms i just didnt know of any other way. how could i use frames as containers. Because the info behind the buttons is going to be more textboxes to fill out? i guess im confused at this point :)
Was This Post Helpful? 0
  • +
  • -

#12 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Convert HTML/Javascript html file to VB code

Posted 19 March 2012 - 10:54 AM

You can use a single form. Add a frame to a form, give it a name such as fraSomeName. Put the stuff that you have one one of your subforms in it (select your controls, cut, select the frame, paste). Do the same with all the other forms and their stuff. Then play with the visible properties of the frames to hide and show the different content.

Also, this:
    If btnClear Then
btnNavilink.Visible = False
    End If
    If btnClear Then
btnBAS.Visible = False
    End If
    If btnClear Then
btnPACE.Visible = False
    End If
    If btnClear Then
btnOmar.Visible = False
    End If
    If btnClear Then
btnWorkstation.Visible = False
    End If

should just be this:
btnNavilink.Visible = False
btnBAS.Visible = False
btnPACE.Visible = False
btnOmar.Visible = False
btnWorkstation.Visible = False

The point is that whatever is in your btnClear_Click sub will execute whenever you click btnClear. Same for all your other click subs.

This post has been edited by BobRodes: 19 March 2012 - 11:03 AM

Was This Post Helpful? 0
  • +
  • -

#13 lgice348  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 13-March 12

Re: Convert HTML/Javascript html file to VB code

Posted 19 March 2012 - 11:46 AM

So i would basically stack the frames on each other? that part is what im not understanding i figured out how to show frames and such but what if i need to use multiple options wouldnt the frames just end up stacking on each other?
Was This Post Helpful? 0
  • +
  • -

#14 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Convert HTML/Javascript html file to VB code

Posted 20 March 2012 - 10:42 AM

That would depend on how you laid out your frames.

If you have the necessity to show multiple frames at once, then maybe you should layout all the frames so that potentially they could all be visible at once and use the visible property to show/hide whatever you need to.

My understanding was that you would select one template option (hence the use of radio buttons originally)?

I'm guessing from Bob's expansion on my frame suggestion, that was his understanding also.
Was This Post Helpful? 0
  • +
  • -

#15 lgice348  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 13-March 12

Re: Convert HTML/Javascript html file to VB code

Posted 20 March 2012 - 10:56 AM

Ok i understand now and going back and looking that is what i was needing i was not taking in the fact of the radio buttons thanks guys for the help ill keep you updated in a few
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2