• Log in or sign up for an account here: https://www.sythe.org/login

A Few More Questions

0h n035

Active Member
Joined
Feb 1, 2007
Sythe Gold
0
Messages
163
Location
Australia
Hullo. I've been progressing quite nicely with my client, but now I'm deciding to make a Web Browser.

Just wondering, will this work for all resolutions?

Code:
Private Sub Form_Resize()
' 21480 - client width
' 21600 - browser width
' 12690 - client height
' 11250 - browser height
Wweb.Width = Browser.Width - 120
Wweb.Height = Browser.Height - 1927
End Sub

My Resolution is 1440 x 990 and it looks perfect, but would it look the same for someone with a resolution of 1024 x 768?

Secondly, could someone explain each line of this code:

Code:
AUWstr = Shares.Inet1.OpenURL("http://money.ninemsn.com.au/shares-and-funds/quotes?subsectionid=4068&subsectionname=Researchacompany_Quotes&code=AUW&ctry=AX&inforeq=Quotes")
AUW1() = Split(AUWstr, "<td class=")
AUW2() = Split(AUW1(1), "<td class=""quoteChangeUp"">")
AUW3() = Split(AUW2(0), """quoteLastSale"">")
AUW4() = Split(AUW3(1), "</td>")

To be honest, I ripped it, but I got it to grab numbers from a shares page for my Dad. Now I'd like to know exactly what I've done :P The things that confused me were the (1) and (0) parts. So far, all I know is that it's making the Inet in the Shares Form navigate to te page up there and the source code of that page becomes AUWstr. Then AUW1, 2, 3 and 4 split it up to find exactly what I want. The main thing I want is an explanation (If mine is wrong) and what the (1) and (0) parts are for. My guess is that its Before and after or between.

My last question is about the Mozilla Control. I've added it to my Web Browser and in the installation I've included the ocx and mozctlx.dll. Yet when installing it asks for you to search for a Bin Folder and when run, my users (Not me, but the rest of my users [Even the ones with FireFox]) get this error:

http://img413.imageshack.us/img413/7894/againon9.jpg

When I got this Mozilla Control, It downloaded a bunch of files in my Program files directory. I included ALL of them in the installation, but still no success.

Any idea?
 
Hullo. I've been progressing quite nicely with my client, but now I'm deciding to make a Web Browser.

Just wondering, will this work for all resolutions?

Code:
Private Sub Form_Resize()
' 21480 - client width
' 21600 - browser width
' 12690 - client height
' 11250 - browser height
Wweb.Width = Browser.Width - 120
Wweb.Height = Browser.Height - 1927
End Sub

My Resolution is 1440 x 990 and it looks perfect, but would it look the same for someone with a resolution of 1024 x 768?

Hmm why dont u make the web browser fit to the forms width?

Code:
Wweb.width = me.scalewidth
Wweb.height = me.scaleheight

Secondly, could someone explain each line of this code:

Code:
AUWstr = Shares.Inet1.OpenURL("http://money.ninemsn.com.au/shares-and-funds/quotes?subsectionid=4068&subsectionname=Researchacompany_Quotes&code=AUW&ctry=AX&inforeq=Quotes")
AUW1() = Split(AUWstr, "<td class=")
AUW2() = Split(AUW1(1), "<td class=""quoteChangeUp"">")
AUW3() = Split(AUW2(0), """quoteLastSale"">")
AUW4() = Split(AUW3(1), "</td>")

To be honest, I ripped it, but I got it to grab numbers from a shares page for my Dad. Now I'd like to know exactly what I've done :P The things that confused me were the (1) and (0) parts. So far, all I know is that it's making the Inet in the Shares Form navigate to te page up there and the source code of that page becomes AUWstr. Then AUW1, 2, 3 and 4 split it up to find exactly what I want. The main thing I want is an explanation (If mine is wrong) and what the (1) and (0) parts are for. My guess is that its Before and after or between.

My last question is about the Mozilla Control. I've added it to my Web Browser and in the installation I've included the ocx and mozctlx.dll. Yet when installing it asks for you to search for a Bin Folder and when run, my users (Not me, but the rest of my users [Even the ones with FireFox]) get this error:

http://img413.imageshack.us/img413/7894/againon9.jpg

When I got this Mozilla Control, It downloaded a bunch of files in my Program files directory. I included ALL of them in the installation, but still no success.

Any idea?

Code:
AUWstr = Shares.Inet1.OpenURL("http://money.ninemsn.com.au/shares-and-funds/quotes?subsectionid=4068&subsectionname=Researchacompany_Quotes&code=AUW&ctry=AX&inforeq=Quotes")
The String AUWstr has been set to make inet open up a URL... not sure bout the Shares.inet1...

Code:
AUW1() = Split(AUWstr, "<td class=")
AUW2() = Split(AUW1(1), "<td class=""quoteChangeUp"">")
AUW3() = Split(AUW2(0), """quoteLastSale"">")
AUW4() = Split(AUW3(1), "</td>")
This is grabbing the source code of the page to find out sales or something and splitting it so viewers can find out in like a label, textbox, etc.
 
Hmm why dont u make the web browser fit to the forms width?

Code:
Wweb.width = me.scalewidth
Wweb.height = me.scaleheight

I got bits and pieces around the place so that works for me.

Code:
AUWstr = Shares.Inet1.OpenURL("http://money.ninemsn.com.au/shares-and-funds/quotes?subsectionid=4068&subsectionname=Researchacompany_Quotes&code=AUW&ctry=AX&inforeq=Quotes")
The String AUWstr has been set to make inet open up a URL... not sure bout the Shares.inet1...

That's because this function is in another file. It's Shares.Inet because the Inet is in the Shares Form.

Code:
AUW1() = Split(AUWstr, "<td class=")
AUW2() = Split(AUW1(1), "<td class=""quoteChangeUp"">")
AUW3() = Split(AUW2(0), """quoteLastSale"">")
AUW4() = Split(AUW3(1), "</td>")
This is grabbing the source code of the page to find out sales or something and splitting it so viewers can find out in like a label, textbox, etc.

Cool, that's what I thought. Just need an explanation about the (0) and (1) bits.
 
Yours will not work on all screen res's as the "-120" part is in twips. Now your screen resolution is the same as mine and our twips per pixel is 15. But it varies from monitor to monitor and size to size. So you this method.

Code:
Private Sub Form_Resize()
' 21480 - client width
' 21600 - browser width
' 12690 - client height
' 11250 - browser height
Wweb.Width = Browser.Width - (8 * Screen.TwipsPerPixelX)
Wweb.Height = Browser.Height - (128.46666 * Screen.TwipsPerPixelY)
End Sub
 
Yours will not work on all screen res's as the "-120" part is in twips. Now your screen resolution is the same as mine and our twips per pixel is 15. But it varies from monitor to monitor and size to size. So you this method.

Code:
Private Sub Form_Resize()
' 21480 - client width
' 21600 - browser width
' 12690 - client height
' 11250 - browser height
Wweb.Width = Browser.Width - (8 * Screen.TwipsPerPixelX)
Wweb.Height = Browser.Height - (128.46666 * Screen.TwipsPerPixelY)
End Sub

Thank you very very much. You're a legend ;)
 
Hmm... Another Question. I've got a frame which I want to be draggable. I've tried lots of different things, but it won't work. I don't want it to only be draggable into certain parts, I want it to be draggable across the whole form.

Anyone know how I could do that?
 
Hmm... Another Question. I've got a frame which I want to be draggable. I've tried lots of different things, but it won't work. I don't want it to only be draggable into certain parts, I want it to be draggable across the whole form.

Anyone know how I could do that?

Set the following properties on your Frame:
DragMode: 1 - Automatic
OLEDropMode: 1 - Manual

The add this to your Form:
Code:
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
    Source.Left = X
    Source.Left = Y
End Sub

That is a dodgy way to do it, but it does the job (roughly).
You can fine tune it by getting the Co-ordinates of where the control was before you starting to drag it. You can do that in the following Frame Event.
Code:
Private Sub Frame1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)

End Sub
 
I'm sure cruel posted a source for that a long time ago (about a year) mind you it was a simple, x1-x2 source, but still nifty none-the-less
 
Set the following properties on your Frame:
DragMode: 1 - Automatic
OLEDropMode: 1 - Manual

The add this to your Form:
Code:
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
    Source.Left = X
    Source.Left = Y
End Sub

That is a dodgy way to do it, but it does the job (roughly).
You can fine tune it by getting the Co-ordinates of where the control was before you starting to drag it. You can do that in the following Frame Event.
Code:
Private Sub Frame1_DragOver(Source As Control, X As Single, Y As Single, State As Integer)

End Sub

1. You did Source.Left twice XD
2. It didn't work. Here's the settings I have:

Appearance: Flat
Border Style: 0 - None
ClipControls: True
DragMode: 1 - Automatic
OLEDropMode: 1 - Manual
Enabled: True

It's a frame with a square around another frame. Inside that inside frame is a webbrowser. Whenever I drag the Outer Frame, it moves back when I lift my finger off the Mouse Button

I'm sure cruel posted a source for that a long time ago (about a year) mind you it was a simple, x1-x2 source, but still nifty none-the-less

I'll look for it. If you find it (Or something Similar, let me know).
 
Tried to search, tried 3 times, no results. Heres my version

Code:
Dim sStoredX As Single, sStoredY As Single


Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single)
    Frame1.Move X - sStoredX, Y - sStoredY
End Sub

Private Sub Frame1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Frame1.Drag 1
    sStoredX = X
    sStoredY = Y
End Sub
 
That won't work either.

And Covey, I've done that :(

EDIT: Nvm that question. I'll just make a drag-able, border-less form instead ;)

EDIT2: Next Question. How do I keep my Border-Less Form Visible even when my Main form has the focus. At The moment when it loses focus, it minimizes. How do I stop that and keep it on top.

EX: I Have this Border-less frame open. I then click my main form. At the moment, my Border-Less frame disappears. I would like it so that it doesn't disappear, but the Form I clicked still has focus. I tried the same thing as my splash form, but then when I minimize my main form, my Border-Less form still shows up (The thing I have on my splash makes it stay on top of EVERYTHING [Unminimizable]).
 
That won't work either.

And Covey, I've done that :(

EDIT: Nvm that question. I'll just make a drag-able, border-less form instead ;)

EDIT2: Next Question. How do I keep my Border-Less Form Visible even when my Main form has the focus. At The moment when it loses focus, it minimizes. How do I stop that and keep it on top.

EX: I Have this Border-less frame open. I then click my main form. At the moment, my Border-Less frame disappears. I would like it so that it doesn't disappear, but the Form I clicked still has focus. I tried the same thing as my splash form, but then when I minimize my main form, my Border-Less form still shows up (The thing I have on my splash makes it stay on top of EVERYTHING [Unminimizable]).

Use the SetParent API, i can't be assed posting an example.
 
Use the SetParent API, i can't be assed posting an example.

Okay. Unlike most people, I like (And am willing) to learn.

I'll look it up and see what I can do :D

Thanks for all your help by the way. Without you guys, my client would be nothing :p
 
Sounds like you are going too round-a-bout with this, a dragable frame would suffice (But for some raisin it doesn't work for you)


To keep your form on top, either Google or search for SetWindowPos API, many websites will give you an instant example on how to set it to either ontop, onbotton, or normal.
 
Well I found out a code to put forms on top and can be turned on and off (Unlike my splash), but I can't get this to work:

Code:
If Main.WindowState = vbMinimized Then
MakeTopmost Me, False
Else
MakeTopmost Me, True
End If

Is there some thin wrong? Should it be in a certain sub? Why won't it work?

NOTE: Yes, I did have that in a sub, but I know it's wrong.
 
Err if that "MakeTopmost" sub is using the SetWindowsPos API it will only set the window position on the screen (i believe) not fix it to your other form like SetParent would do.

(But for some raisin it doesn't work for you)

:D
 
Err if that "MakeTopmost" sub is using the SetWindowsPos API it will only set the window position on the screen (i believe) not fix it to your other form like SetParent would do.



:D

Yup it's SetWindowPos. I'll keep looking for SetParent ;)

EDIT: Alright, I have SetParent and it's ALMOST Perfect.. It stays inside my Main form just like I want it to, but...

1. I can't drag it like I used to be able to. If you're wondering, It's a borderless form and I have a command button (For now) that you can drag it along with.
2. There's a Webbrowser inside this child form and when I click th textboxes on the page it loads, nothing happens. You can't type anything into them.

So yeah. All it's doing is putting the form there... And I can't do ANYTHING with it... Except look at it...
 
Ok forget SetParent ill just make you a demo dragable frame.

EDIT:
This is a very poor way of doing it.
Code:
Option Explicit
Private blnMouseDown As Boolean

Private Sub Frame1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    blnMouseDown = True
End Sub

Private Sub Frame1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If blnMouseDown = True Then
        Frame1.Left = X
        Frame1.Top = Y
    End If
End Sub

Private Sub Frame1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    blnMouseDown = False
End Sub
 
Ok forget SetParent ill just make you a demo dragable frame.

EDIT:
I should be done in approximately 5 minutes, i'll re-edit this post when i'm done.

Wow, thank you very much :D

EDIT: I've gotta go to my dad's, but I'll try it out when I get there. It looks like it'd work though :D

Thank you very much! As I've said before, you're a legend :)
 
duelarena.gg
Back
Top