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

[RESOLVED] Non-Standard Font

$
0
0
I have a font for JEOPARDY! (gyparody.ttf) downloaded to my computer. How do I use this font in a VB6 application (label, textbox, etc)?

Edit: I did install it in my Windows 10 machine, and I see it when I view fonts on the computer (Control Panel, Appearance and Personalization, Fonts).

Edit 2: Never Mind....I had to close the currently opened VB6 Application, then reopen it (I install the font while that app was open). Now I see it in the list provided by VB.

[RESOLVED] fill in listview subitem

$
0
0
Hi experts
I need to loop through the listview subitems(2) items and populate the listview subitems(3) as shown in the picture.
Name:  lvw.png
Views: 40
Size:  1.8 KB

val(ListView1.ListItems(i).SubItems(3) = the difference between the item in ListView1.ListItems(i).SubItems(2) and the preceding item.
something like this:
20....... 0
25...... .5
27........2
I wish you understand me
thank you
Attached Images
 

What's the right one to choose?

$
0
0
I'm trying to create a code wherein if I open another application my own form/application follow suite... I was thinking of Conditional statement and with the use of "shell" or use an API call "SetForegroundWindow" which basically I don't have any experience of using this API call, so I still don't know what it could do?

Can VB6 use JavaScript or HTML5 chart controls?

$
0
0
About the chart control, I have the following questions:

(1) FasionCharts for VB6 is the best VB6 chart control I've ever seen, but this control was abandoned by its developer InfoSoft Global a few years ago. I know that the development workload of a similar chart control is very large if we start from scratch. Is there a third-party graphics library such as vbRichClient5 (Cairo graphics engine) that can reduce the development workload of this chart control? Or whether there is a better product that can replace FusionCharts for VB6.

(2) Now many people are using JavaScript and HTML5 development chart control, if VB6 apps can use these chart controls it would be great. (I mean wrapping a JavaScript or HTML5 chart control into an OCX control for VB6 calls like FusionCharts for VB6.)

My current work doesn't need to use the chart control, I am only interested in this issue.

INSERT image in subitems of lisvtview

$
0
0
I need to insert a Gif image(is a little image) in subitems of lisview from dir c:\dir1\image.gif, not from imagelist.
How to?

How does Spy++ highlighting work?

$
0
0
Hey everyone, in Spy++, if you are navigating the window tree hierarchy where it lists Windows parents and there children there is an option where you can right click on one of those elements and click "Highlight". When you do that it will flash a border around the window showing you where it is on the UI.

I would like to learn how to do that with VB6. I want to use the feature highlight windows and there controls to create sort of a tutorial to teach somebody how to do something, ie first push this button (highlight) and then push this button (highlight) etc...

[RESOLVED] RC5 form.visible is true after close it

$
0
0
Checking the "1 Hello Form-Engine (basics)" from RC5 I found fMain.Form.Visible = True, after exit from Cairo.WidgetForms.EnterMessageLoop and no form is visible;
Why this happen
Working with M2000 interpreter, revision 3 of version 8.8 I can make all objects, without references on vbcode (on interpreters dll), using M2000 commands, and got events also that runs M2000 code, and without EnterMessageLoop, using M2000 loop for threads - working threads behind RC5 forms- but then I found visible was not change it, so i use for exit a keypress(1) - mouse click on M2000 console. I am in trials with new M2000 code, but visible on form must be false if form is not shown.



Code:

Option Explicit
 
Public New_c As New cConstructor, Cairo As cCairo

Public fMain As New cfMain
 
Sub Main()
  Set Cairo = New_c.Cairo
 
  fMain.Form.Show
 
  Cairo.WidgetForms.EnterMessageLoop 'this is required, since no VB-Forms are involved
  MsgBox "coocoo"
  Debug.Print fMain.Form.Visible  ' this is TRUE but Form is not visible
End Sub

create new papersize

$
0
0
On windows, when a print a document, you may want to select what papersize to use like letter, legal, a4, etc.

Now, if the papersize is not there, you go to print server setting and add new papersize.

my question is how do you create this programmatically through vb6 app.

Label hides behind other controls. ZOrder doesn't bring it to the front.

$
0
0
Hi.
I have a form with a lot of controls on it (SSTabs, Frames on the SSTabs, Textboxes, checkboxes, etc. on the Frames, etc).
I have placed a label directly on the form (on the bottom of all the above controls), and I have set the Visible property of this label to False (because usually it must be invisible).
The purpose of this label is to show a message to the user in case something happens.
Let's say I show this message if a Commandbutton is pressed:
Code:

Private Sub Command1_Click()
  Label1.FontBold = True
  Label1.FontSize = 14
  Label1.Visible = True
End Sub

It works perfectly.

Now, I change the above code a little bit, to show that message in the middle of the screen:
Code:

Private Sub Command1_Click()
  Label1.FontBold = True
  Label1.FontSize = 14
  Label1.Top = 3000
  Label1.Visible = True
End Sub

This does not work. The message does not show.
And the reason is obvious: It is hiding behind all those controls (SSTabs, Frames, Textboxes, etc)

In order to fix this problem and make the message show, I use ZOrder as follows:
Code:

Private Sub Command1_Click()
  Label1.FontBold = True
  Label1.FontSize = 14
  Label1.Top = 3000
  Label1.Visible = True
  Label1.ZOrder 0
End Sub

But this STILL does not work. The message does not show.
I guess the label is still hiding behind all those controls (SSTabs, Frames, Textboxes, etc) even in spite of ZOrder being set to zero.
But, why?
And how can I fix this?
I need to show this message on the screen, on top of every other control.
How can I do that?
Please advise.
Thanks.

This isn't working right!! Resource file extraction data process

$
0
0
Dear VBForumers, here is ThEiMp talking to you, today here on in. I am looking to simplify the source code in this Code block tags, below. I wish to have the UserControl to execute the Video file, and play it in the ActiveX Control Object which is the Media Player Control for Windows 10 Professional. Then when the video is finished playing then to delete the file off the local disk and then to be in standby mode for another command by the end-user, even.
Code:

Private Sub UserControl_Initialize()
On Error Resume Next

Dim strBuff As String
     
    strBuff = StrConv(LoadResData("1", "WEBM"), vbUnicode)
   
    Open "c:\Temp\1.webm" For Output As #1
        Print #1, strBuff
    Close #1
   
    Shell "c:\Temp\1.webm", vbMaximizedFocus
End Sub

!! Thanks in advance !!

TabStrip control in vb6

$
0
0
I use TabStrip control in vb6.
I insert Tab1 and Tab2.On the TabStrip put PictireBox1/named ChoiceFrame(0)/ and Frame1 .
On the PictureBox1 and Frame1 I put PictureBox2/named ChoiceFrame(1)/and Frame2.
Once I Run the program,problem is that the Frame2 is visible on the PictireBox1!
I would like the controls placed on the PictureBox2 not to be visible on the PictireBox1.
Thanks!
PHP Code:

Private SelectedTab As Integer

Private Sub Form_Load()
Dim i As Integer

    
' Move all the frames to the same position
    ' 
and make them all invisible.
    For 
1 To ChoiceFrame.UBound
        ChoiceFrame
(i).Move _
            ChoiceFrame
(0).Left_
            ChoiceFrame
(0).Top_
            ChoiceFrame
(0).Width_
            ChoiceFrame
(0).Height
        ChoiceFrame
(i).Visible False
    Next i
    
    
' Select the first tab.
    SelectedTab = 1
    TabStrip1.SelectedItem = TabStrip1.Tabs(SelectedTab)
    ChoiceFrame(SelectedTab - 1).Visible = True
End Sub




Private Sub TabStrip1_Click()
    ChoiceFrame(SelectedTab - 1).Visible = False
    SelectedTab = TabStrip1.SelectedItem.Index
    ChoiceFrame(SelectedTab - 1).Visible = True 

AnimateWindow broken post-XP?

$
0
0
I'm not sure when AnimateWindow quit working. I was sure it was working Ok even for a simple PictureBox in the past. But I can't get it working right for a UserControl either.

Something like a simple TextBox seems Ok yet, but I'm sure the issues necessary were addressed within common system controls like the one inside a TextBox.

This is broken on Windows 10 though it might work yet on something earlier:

Name:  sshot Broken.png
Views: 64
Size:  1.3 KB


I have two fixes but one has an awful flicker on Form Load (it has to make the UserControl visible to do a capture on it), here is the second one that works as desired:

Name:  sshot Fix 2.png
Views: 56
Size:  2.4 KB

Surely there is a better alternative though? The gyrations I'm going through seem beyond unnecessary.
Attached Images
  
Attached Files

[RESOLVED] how to get the button name that is pressed

$
0
0
hey
i have 10 buttons with index that each button has a diffrent name
my question is how can i get the name of the button that is pressed?
e.x
btn(1) name = salsa
btn(2) name = mambo
and so on
regards
salsa :)

C DLL Call from BV6

$
0
0
Greettings,

I have a C Dll I made, which exports decorated functions easely used in my VB6 program. However, there's another software I'm making which only accepts undecorated ones - I've adapted the output. For simplicity, I'm trying to make VB6 to accept also undecorated functions (so the DLL would be common), but without any luck...

Is there a way to do this in VB6? Or can it be done in VB.NET only, maybe?

I apreciate the help.

Kind regards,

JKpeler

Failed to read large sqlite table (vbRichClient5)

$
0
0
There is a large data table in my sqlite database, it has more than 30 fields, 12000 records, and there are a lot of pictures in it.

I have been using Olaf's dhRichClient (previous version of vbRichClient5) to handle sqlite data. It has been working very well. But these two days it read data failed, I guess the reason is that there is too much data in the single table. So I switch to vbRichClient5 to handle Sqlite data, but still goes wrong.

The source code is as follows:

Code:

Set rs = New vbRichClient5.cRecordset
strsql = "select * from test1"
rs.OpenRecordSet strsql, conn, True

On XP:
The error code line is: rs.OpenRecordSet strsql, conn, True
The error message is: Rs-construction: Cannot allocate more memory!

On Win10:
The error code line is: rs.OpenRecordSet strsql, conn, True
The error message is: Cannot execute Select-Statement: database disk image is malformed (11)


I did the following test:

(1) If I changed the code line as follows:
strsql = "select top 10000 * from test1"
then RC5 can read data correctly.

(2) If I changed the code line as follows:
strsql = "select top 12000 * from test1"
then RC5 can't read the data

I guess the reason for the error is that vbRichClient5.cRecordSet will read all the table data into memory at one time. How to solve this problem? Thanks in advance.



Edit:
I know ADODB.RecordSet can read data like this:
Code:

Dim adoRs As New ADODB.Recordset
adoRs.Open strsql, Cnn, adOpenForwardOnly

But there isn't a parameter similar to adOpenForwardOnly in the vbRichClient5.cRecordSet.

how do i color each listsubitems?

$
0
0
hey
is there a way to color each listsubitem row?
e.x
first row name is salsa and the color is red
second row is mambo the color is green
this is the code i am using to load from the database
Code:

    Dim Rs As New ADODB.Recordset
    Rs.Open "Select * From PriceList Order By PriceName", CN
    LsVw.ListItems.clear
    Do While Not Rs.EOF
    Set itm = LsVw.ListItems.Add(, , Rs!PriceName, 1)
        itm.SubItems(1) = Rs!PriceColor ' Here i want the color
    Rs.MoveNext
    Loop
    Rs.Close

of course i need to loop to get for each name its color
appreciate any help
salsa :)

how to fix overflow error

$
0
0
Hello,
I am connecting a modbus device (RTU protocol) and I have a vb6 program to read and show the data from floating point registers of my device to textbox (i used mbmasterv71.ocx in this program):

Code:

Dim MyData(2) As Integer
Dim MyDataSwapped(2) As Integer
Dim fValue As Single

'******Get two 16bit registers and read into MyData Array******
For i = 0 To 1
MyStatus = MbMasterV71.ReadResults(hConnect, Slave_Address, Command, Address + i, MyData(i))
Next i
MyDataSwapped(0) = MyData(1)
MyDataSwapped(1) = MyData(0)

'*****Copy the data from the register array******
CopyMemory fValue, MyData(0), 4

Then show fvalue to a textbox
It work nomarly but sometime the overflow error appear in line: MyDataSwapped(0) = MyData(1)
But i don't know the reason. So i need someone help me fix this error

obfuscate tool

$
0
0
does anybody knows a free obfuscation tool to obfuscate my vb6 codes?

[RESOLVED] how do i color each listsubitems?

$
0
0
hey
is there a way to color each listsubitem row?
e.x
first row name is salsa and the color is red
second row is mambo the color is green
this is the code i am using to load from the database
Code:

    Dim Rs As New ADODB.Recordset
    Rs.Open "Select * From PriceList Order By PriceName", CN
    LsVw.ListItems.clear
    Do While Not Rs.EOF
    Set itm = LsVw.ListItems.Add(, , Rs!PriceName, 1)
        itm.SubItems(1) = Rs!PriceColor ' Here i want the color
    Rs.MoveNext
    Loop
    Rs.Close

of course i need to loop to get for each name its color
appreciate any help
salsa :)

View Webbrowser body content

$
0
0
hi is it possible to view the content ie: post/get, referrer, request body of a http request sent by webbrowser control or see the response of the server? i know i can view it through fiddler but can i do this internally within my app?
Viewing all 21919 articles
Browse latest View live


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