Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all 21896 articles
Browse latest View live

Saving a gif image with webbrowser 1 without prompting

$
0
0
hi everyone , i have been looking for this code for some time ago and i can not get the correct code for it .

i have looked in forum for this code and all i can find is to save the html , or search the image links in html .

what i need is to open a direct image with webbrowser1 and save it to a specific location .

I was looking at this code and it works great if it is html :

Private Sub command1_Click()
Dim path As String
Dim HTMLcode As String
path = app.path + "\html\test.html"
WebBrowser1.Navigate "http://somesite.com/lala.html"
Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE ' wait for load completely
DoEvents
Loop
HTMLcode = WebBrowser1.Document.documentElement.innerHTML
Open path For Output As #1
Print #1, HTMLcode
Close #1

this code works perfect , but what i need is for a gif or a jpg or any other type of image .
something like this :
Private Sub command1_Click()
Dim path As String
Dim HTMLcode As String
path = app.path + "\html\image.gif"
WebBrowser1.Navigate "http://somesite.com/image.gif"
Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE ' wait for load completely
DoEvents
Loop
HTMLcode = WebBrowser1.Document.documentElement.innerHTML
Open path For Output As #1
Print #1, HTMLcode
Close #1

Now , what do i need to change in last code to work with images ?
inet is out of question because some sites don`t allow it to pick the images directly .

Thanks a lot for all the help .

VSFlexGrid FindRow functionality question

$
0
0
Greetings,

I'm examining pre-written code that has a VSflexgrid component where the values have been populated at a cell level with textmatrix command and has nothing set at .rowdata level.

Using the .findrow function am I right in thinking this will not allow all the rows and columns to be searched for a specific text string?

Only if I search for the specific column does it seem to find the value e.g.
Code:

lngFoundRow = .FindRow(strSearchValue, lngHeaderRow + 1, 15, False, False)
In code it looks like from the comments that it expects all rows and columns (apart from the header row) to be searched, can someone please clarify if this is achievable, thanks?

Cheers
Rob

[RESOLVED] Visual Basic 6

$
0
0
How to sore numeric values in combo box (e.g 1 ,5,7,10,15,100,157,1007)
i have set sort property to true , then is sorted , but when selected particular item , the cursor is not moving to that item , help me out

[RESOLVED] help: innerhtml

$
0
0
How to get the innerhtml using winsock?

detect connection type

$
0
0
Is there a way to detect if an internet connection is behind a proxy or virtual network using vb6?

Changing Label Text Depending on Drop Down Selection

$
0
0
Hey all,

Not sure where this should be posted but hopefully someone can explain this to me.

I am using Excel 2010 to create my own binary options trading program. Anyway what I am looking to do is have a label which text changes depending on what drop-down selection is made. I will attach a screenshot to help explain:

Name:  screenshotbinary.png
Views: 74
Size:  133.2 KB

I have the drop-down list data range from cells A1 - A10 (EUR/USD, USD/JPY, etc.) and I want Label 5 to display the number in the column G depending on which currency pair is selected (ie. If EUR/USD is selected, Label 5 text should read the value from cell G1).

How would this code look in VB? Would if have to be part of the DropDown_Click() section? Sorry for my noobishness and thanks for any assistance you can give!
Attached Images
 

[RESOLVED] List files with their icons

$
0
0
I was using a FileListBox to display a list of files from a specific directory but I'd like to display them with the corrsponding icon beside the name, just like in windows explorer. Is there a specific control to do that or some trick?

Remove Item from FileListBox?

$
0
0
Is it possible to remove a file from the FileListBox without actually killing the file?

I've already used multiple wildcards in the .pattern, however not getting the result I want.

I want to be able to remove additional files from view in the FileListBox. Is there something like the .removeitem?

help: data not run in pc without visual basic

$
0
0
help me about this
Attached Images
 

[RESOLVED) Saving a gif image with webbrowser 1 without prompting

$
0
0
hi everyone , i have been looking for this code for some time ago and i can not get the correct code for it .

i have looked in forum for this code and all i can find is to save the html , or search the image links in html .

what i need is to open a direct image with webbrowser1 and save it to a specific location .

I was looking at this code and it works great if it is html :

Private Sub command1_Click()
Dim path As String
Dim HTMLcode As String
path = app.path + "\html\test.html"
WebBrowser1.Navigate "http://somesite.com/lala.html"
Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE ' wait for load completely
DoEvents
Loop
HTMLcode = WebBrowser1.Document.documentElement.innerHTML
Open path For Output As #1
Print #1, HTMLcode
Close #1

this code works perfect , but what i need is for a gif or a jpg or any other type of image .
something like this :
Private Sub command1_Click()
Dim path As String
Dim HTMLcode As String
path = app.path + "\html\image.gif"
WebBrowser1.Navigate "http://somesite.com/image.gif"
Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE ' wait for load completely
DoEvents
Loop
HTMLcode = WebBrowser1.Document.documentElement.innerHTML
Open path For Output As #1
Print #1, HTMLcode
Close #1

Now , what do i need to change in last code to work with images ?
inet is out of question because some sites don`t allow it to pick the images directly .

Thanks a lot for all the help .

Auto fill texbox

$
0
0
hay all,

i have project making database for selling item in mart using Barcode. I am scan the barcode then output will shown in textbox1, then textbox2 will showing the item name, and textbox3 for item price.
My question is, how to fill another textbox(textbox 2, 3 and 4) automaticaly?

Flowchart :

1.textbox1 for barcode scanner output (item code)

2. then textbox2 showing the name of the item.

3. then textbox3 showing price of the item.

am try using this command and not working T_T

if textbox1.text = "12345" then textbox2.text = " Owen " else textbox3.text = "1000"
end if

Name:  barcode.jpg
Views: 94
Size:  13.4 KB


thanks you for help me friends ^^
Attached Images
 

24DB Low Pass Filtering - SOUND / AUDIO Processing

$
0
0
Hello chaps,

I'm looking for a Low Pass Filter to apply to a .WAV Audio Buffer.

I've come across this here: LPF 24dB/Oct

But I'm having trouble converting it and getting it to work in VB.

Can anyone shed any light in to this?

Thanks

VB6 SCSI Tape Backup Unit Programming

$
0
0
Hi,

This is a new problem that I am trying to solve. I need to start to control a SCSI unit, exactilly an LTO Tape Bakup Unit, which can be SCSI (LVD, HVD, SATA, Fiber Chanel etc.). I was looking on internet but there are no that much information about this kind of programming. I need to start first with INQUIRY commands and I found that on Windows platform we need to use ASPI wraper in order to comunicate with an SCSI device. I would like to get and I would appriciate any information, link, tutorial or example that can halp me to start with SCSI programming. For the beginning I would like to start with following problem...

1. How to send a INQUIRY command to the drive
2. How to get the basic information from the drive, like Power on haurs, serial number
3. How to get tape info.
4. How to start read/write on/from tape
5. How to get the information about how many data has been written, how many errors, what is the speed of read/write etc.

Any info about above mentioned problems with Python 2.6 or 3 would be more than welkom.

Thanks in advance for any help.

Bad File Mode error?

$
0
0
Hi there everyone. I am working on a newer version for student attendance prog.

I have a sub that loads the list of students from the textfile to an array of label captions. Basically each line of the file goes to a separate label caption like this.


VB Code:
  1. Public Sub LoadClassRoster()
  2.  
  3.  
  4.  
  5.     ' THIS CODE LOADS The Students Names TO the Label Captions
  6.     Dim sFileText As String
  7.         Dim iFileNo As Integer
  8.         Dim iCount As Integer
  9.           iFileNo = FreeFile
  10.               'open the file for reading
  11.              'RosterNumTXT.Text = "1"
  12.           'Open App.Path & "\StudentRosters\Roster1\Roster1.txt" For Input As #iFileNo
  13.           Open App.Path & "\StudentRosters\Roster" & RosterNumTXT.Text & "\" & "Roster" & RosterNumTXT.Text & ".txt" For Random As #iFileNo
  14.         'change this filename to an existing file!  (or run the example below first)
  15.               'read the file until we reach the end
  16.           Do While Not EOF(iFileNo)
  17.            iCount = iCount + 1
  18.              StudentNum.Text = iCount
  19.             Input #iFileNo, sFileText
  20.               'show the text (you will probably want to replace this line as appropriate to your program!)
  21.             AttendanceV3.SignInNameLBL(iCount).Caption = sFileText
  22.           Loop
  23.               'close the file (if you dont do this, you wont be able to open it again!)
  24.           Close #iFileNo
  25. End Sub

However, I just tried it. Basically The RosterNumTxt.text tells it which number from 1-6 to load. So I try 1, but I get the error BAD FILE MODE, and it highlights this line Input #iFileNo, sFileText, did I make a mistake doing this with a textfile entering as a roster number.

Thanks!!!

Copy value, not formula, from one cell and paste to another

$
0
0
Hey guys, I have another question and I do believe this one will be VB related,

I will attach what my sheet looks like now:

Name:  screenshotbinary.png
Views: 73
Size:  144.0 KB

The red arrows there show the cells I'm trying to work with. Basically, when the button is pressed, all the info in under the "Your Positions" section gets entered and the countdown starts. What I'm having trouble getting to work is this: when the button is pressed, I want the "Start" value to be whatever it shows in cell M6 at the time of the button press. The cell under "Current" shows the live current streaming price. Since I am streaming almost all of these values from an online source, just having the Cell1 = Cell2 kind of setup will not work as they will always change. I just want it to basically copy and paste the value in the cell upon the button press.

I have tried a lot of different kinds of copy and paste options, but the other problem I'm having is that, because these values are being streamed second by second, if the live value cell number changes then the "Start" value will change to. I hope I explained this well enough.

Any help with this will be greatly appreciated! Thanks,
Attached Images
 

PDQComm - License information for this component not found. You do not have app licen

$
0
0
Hi !

I have a legacy VB application that uses PDQComm library. I have to rebuild this application after upgrading certain forms in it. The issue is that when I try to rebuild the application I get the following error message.
"License information for this component not found. You do not have appropriate license to use this functionality in the design environment.

PDQComm version that is used in this application is 3.1.9.0.

I have tried registering PDQCom32.ocx using regsvr32, but it did not work.

Please suggest.

DataReport Issue

$
0
0
1. I've installed VB6 Service Pack. Orientation is well taken care with this.
2. I've set default paper size as A4 in Settings..>. ControlPanel..>. Printers...>..Printing Preference.
3. One of my Report should be half of A4 size in Portrait.
4. This is how I've coded..

Code:

If RptSize = "Small" Then
    Printer.PaperSize = vbPRPSA4
    Printer.Width = 16833
    Printer.Height = 11908
    DR.Orientation = rptOrientLandscape
   
ElseIf RptSize = "Big" Then
    Printer.PaperSize = vbPRPSA4
    Printer.Width = 11908
    Printer.Height = 16833
    DR.Orientation = rptOrientPortrait
   
ElseIf RptSize = "VerySmall" Then
   
    Printer.PaperSize = vbPRPSUser
    Printer.Width = 11908
    Printer.Height = 8415      ' half of A4
    DR.Orientation = rptOrientPortrait

   
End If

The colored portion of the code does't work. I need the report to stop in the midway itself. But it goes for entire A4 (as default is set like that).
Is there a way to change the default paper size in PRINTING PREFERENCE programatically ?

Primary key needs to displayed in the datagridview

$
0
0
Hi,

I'm using windows form application and Ms access. I have a tab with datagridview which displays all the orders of the customer(gets data from table in access) and a button to add new order. On click of the button, opens a new tab with textboxes to add new orders. The data saves fine. But when I switch to the tab that displays all the orders in datagridview, all the information except Order ID is not displayed. The order ID is the primary key and autogenerated in Access table. But if I navigate through the records, the order ID is displayed. How Can I get the order ID displayed in the datagridview? Please help

.txt to listbox

$
0
0
I am very new for vb6 as I am a student at school we have just started to learn basic about vb6 .. interesting
I need help here

How can load *.txt file contents to list1 and then similarly when i click list1 item1 list2 should also get the items from same or from another *.txt file from application path or what soever path

Passing a nested UDT array to a sub throws compile error...

$
0
0
Hello everyone,

I'm building a programming tool for an arduino project, but I seem to get stuck now.

background info: when activating a wireless transmitter (Zender in Dutch), the arduino should process 16 programmable commands, described in Zenders(x).Aan(1 to 16). 1 command consists of 3 bytes: The Command itself, the Unit it has to control, and a Value.

The Sub buildZenderAan has to fill a listbox (ZenderAan ~Transmitter activated) with readable lines of text, based on these 16x3 bytes.
And the Sub works if I directly refer to Zenders(x).Aan(1 to 16) (In the sub itself) and the only argument I pass to the sub is x (The number of the transmitter we're programming).

Problem is, that there also is a ZenderUit (~Transmitter DEactivated), and in the near future There will be a clock-function, and wired inputs.
So I thought i'd streamline the sub a bit to accept (and change, if necessary), only the bit that holds the commands.


Code:

Public Type Commando
  Text As String
  Command As Byte
  Unit As Byte
  Value As Byte
End Type

Public Type Zender
  Naam As String * 16
  Adres As String * 8
  Aan(16) As Commando
  Uit(16) As Commando
End Type

Public Zenders(96) As Zender

Code:

Public Sub buildZenderAan(ByRef intarray() As Commando)
  blahblahblah
End Sub

When trying to start the application, it immediately throws an error: 'compile error: Type mismatch: array or user-defined type expected'

Code:

buildZenderAan (Zenders(1).Aan)
Well, maybe it's me, but I definitely think I'm passing an array. Or aren't I? Help?:o
Viewing all 21896 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>