Quantcast
Viewing all 21376 articles
Browse latest View live

[RESOLVED] Adjust text height to fit in label width.

Problem with adjusting text point size to fit in width wise to a label.

Basicly how to enumerate point sizes available in given font, so to substract correct value from previous point size?

Code below runs in endless loop, because Label1.Font.Size = Label1.Font.Size - 0.25statement does not work.

or is there more solid method?

Fontfamily (helvetica, times etc.), font point size (whole integers ie. 10, 12), field area (label width) in pixels, are defined in xml file - so only sound method to display whole text is to adjust it's point size. Currently there is slight mismatch and text is sometimes clipped. I have user scalemode defined form, which represents Left, Top, Width and Height ie. page size defined in XML file.

Labels (field) widths are defined in XML file, so label width can't be (easily) changed - as some field/texts are going to overlap.

Code:

Private Sub Form_Load()
    Me.AutoRedraw = True
    Me.Font.Name = "Arial Narrow"
    Me.Print "ABCDEFGHIJKLMNO"
    Label1.Font.Name = "Arial Narrow"
    Label1.Font.Size = 10
    Label1.Width = 109 'set to some width
End Sub

Private Sub Command1_Click()
Dim sText As String
sText = "ABCDEFGHIJKLMNO"
Label1.Caption = sText
Set Me.Font = Label1.Font
Debug.Print "Label1.Font.Size before " & Label1.Font.Size
    Do
    If Me.TextWidth(Label1.Caption) > Label1.Width Then
        Label1.Font.Size = Label1.Font.Size - 0.25
        Debug.Print Me.TextWidth(Label1.Caption)
    Else
        Exit Do
    End If
    Loop
Debug.Print "Label1.Font.Size after " & Label1.Font.Size 'Should be adjusted point size to value where text fits inside label.
End Sub


[RESOLVED] Is it possible to integrate VB 6.0 DLL to other Applications?

I just like to ask something if it would be possible to use Active X DLL in VB 6.0 with other applications. So that when I open/Install an application, files or folder, my form will show up first to generate a login password... If I create a notepad "Test.txt" and a DLL in the same folder. Notepad will call on the DLL to open a form password?!

INSTR and string position....

i loop a txt file line by line.

i need to check position of string in string line...

for example is use to check "AAABBB" in line string:

if instr(myline,"AAABBB")>0 then
'ok
end if

when the instr is true how to check the mid position of string "AAABBB"?

why?

The string "AAABBB" have a variable position and not static position in txt line

How to?

Win7 32bit incompatibilities with VS6 and VB6

My VB6/Vc++ application uses the built in timer object. The VB app communicates back and forth with the C++ app at specific times. This was not an issue with previous versions of Windows, with migration to Win7 now it seems that the timing is no longer synchronized and the C++ process hangs up.
On previous versions of Windows I found that on multi-core or multi-processor computers I had to disable processors and cores until it looked like a single core, single processor computer. I think I got that accomplished on this Win7 machine, in task manager/Performance there is only one graph displayed for CPU usage. Previously there were 4. Is there a compatibility issue with the timer? and is there a fix???

Thank You.

[RESOLVED] How to load data from txt file without space ?

i have this code to load data from txt file to msflexgrid

and i have 2 txt file Data1.txt & Data2.txt

The difference between the Data1 and Data2 is in the spaces between words

the code load data1.txt without any problem but when i try to open data2.txt don't load in msflexgrid because the file contains many space

I want to modify this code to ignore any space in the file to open the file like data1

Waiting for help

Source code in attachments

thank you very much
Attached Files

decimal in a label

Hi.
I have 3 labels that have decimal numbel 3.2 and 0.9 and 2.7 for example
I use this label4.caption=val(label1.caption)+val(label2.caption)+val(label3.caption and the result is 5 (add only the integer)
i try some variables but...)
thanks

Flexgrid

Image may be NSFW.
Clik here to view.
Name:  test.jpg
Views: 48
Size:  30.6 KB


The column QTY is editable, what I want is to limit the value that the user can enter. On the picture above the default value is 2, what I want is the user can only enter value equal or less than with the existing value. Is it possible?
Attached Images
Image may be NSFW.
Clik here to view.
 

Popup Menu

I have a popup menu that becomes visible from the tray notification area when I click on an icon. The popup menu has several options. The main form does not have to be visible when the popup menu is visible. In the case when the main form is not visible and I choose not to select any of the menu options, I need to have the menu close when it loses the focus. I can't seem to trap that event.

Any suggestions would be appreciated.

Thanks

not enough memory error

Hi I am using ADO to load data into an array and I am getting an error. Actually I've seen 2 different runtime errors.
Runtime Error 7 : Out of Memory
and
Not enough storage is available to complete this operation

debugger leads to this line.

Code:

returnarray = myRecSet.GetRows
so my computer is running out of memory and can't load the rows into my array?
Is there a way to allocate more memory? It's hard to believe so much data is coming through that it can't load this array.
Based on my calculations I think I am trying to load 1,024,000 records into the array.

any ideas what I should do?

[RESOLVED] Is There a way to sync Events From Access to google calendar?

Is There a way to sync Events From Access to google calendar?
did some one ever tried this before?
any help will be appreciated
salsa :)

[RESOLVED] Popup Menu

I have a popup menu that becomes visible from the tray notification area when I click on an icon. The popup menu has several options. The main form does not have to be visible when the popup menu is visible. In the case when the main form is not visible and I choose not to select any of the menu options, I need to have the menu close when it loses the focus. I can't seem to trap that event.

Any suggestions would be appreciated.

Thanks

440 Automation Error

I work on a company with a lot of systems developed on VB 6, yesterday a client called me because his system can open 4 windows each one with a datagrid. Someone how stopped to work on 3 of them computers and honestly I don't know what else I could do...I already registered the mscomctl.ocx on their computers and didn't work, I already installed the package from visual studio 6 from Microsoft and again didn't work. I started to work with MsgBox to see if I could find the line of the error and the only message that I can show it's this message "MsgBox ("Vai entrar no Historico Run")" after that I receive the error 440 Automation Error.I'll put some code here and photo to see if anyone can help me.

Code:

Me.Enabled = False
    MsgBox ("Vai entrar no Historico Run")
    frmHistoricosRun.Show
    Me.Visible = False
    tmrAltPanel.Enabled = False

Private Sub Form_Load()

On Error GoTo ErroForm_Load
    MsgBox ("Vai iniciar formatação dos textos")
    Call langTRun
    MsgBox ("Passou pela formatação dos textos")
    Call setHeadTRun
    MsgBox ("Criou o data grid")
    Call setBodyTRun
    MsgBox ("Passou pelo tratamento dos dados")
    Exit Sub

ErroForm_Load:
    MsgBox (Err.Source)
    sgdTRun.Redraw = True
    Screen.MousePointer = vbDefault

End Sub

Image may be NSFW.
Clik here to view.
Name:  imagem.jpg
Views: 55
Size:  28.4 KB
Attached Images
Image may be NSFW.
Clik here to view.
 

multi search in txt files

Hi!

I have a problem with txt files.

There are may txt files in folder. I need to search a few string in txt files.

For example;

Within each file

"11.10.2016", alex martin, 123456789,500,2500,12000,"london","34100"
"19.12.2016", michael, 8500025122,1500,2500,12000,"paris","06000"
"11.10.2016", jason, 123456789,500,2500,12000,"new york","34100"
"19.12.2016", michael, 8500025122,1500,2500,12000,"paris","06000"

There are thousands of such records.


For example, it scans all .txt files in the folder in "19.12.2016", "12000" and "paris" words . Can I write to another txt file ?

sorry for english

Thank you

Extracting date from string with other info in it

I have a bunch of files where I need to extract the date from the file name. The format and wording of the file name is not consistent and can vary.

"3-26-15.txt"
"5-16-14 wed.txt"
"wed 5-16-14.txt"
"3-22-12 Monday"
"June 4 2015.txt"
"Jun 5 2016 Tues.txt" (some file have 3 letter month)

using: Format$(CVDate(FileName), "mm-dd-yy DDDD") on the filename with the extension removed. I am able to get a valid date as long as I manually remove the day of the week (Monday, Mon, wed, etc) if it even exists in that particular string.

I need to end up with a string that is a valid date for these various file name regardless of if they have the day of the week in them.

the final output I need should be formatted "mm-dd-yy DDDD" for each item regardless of the actual text in the file name

Thanks

Linker Error & Where/How do I see Linker Command

Hi All,

I've known this stuff before, but forgotten it. I'm trying to compile a VERY large VB6 project and I'm getting a linker error:

Image may be NSFW.
Clik here to view.
Name:  LinkerError.gif
Views: 28
Size:  10.0 KB


Just to make sure VB6 was okay, I compiled a much smaller project, and that worked fine.

I also tried compiling this large project both from the IDE and from a batch file. Just FYI, here's my batch file command:
Code:

"C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6" /MAKE "C:\Users\Elroy\Desktop\Shriners\Database\Source Code\PatientsAndServices.vbp"
I'm thinking possibly the linker command line is too long, but I don't remember how to check this. Is there some way to get VB6 to show you the linker command? Also, any other ideas would be appreciated.

Regards,
Elroy
Attached Images
Image may be NSFW.
Clik here to view.
 

[RESOLVED] Automatically starting a VB6 program

I know how to auto start a program when I start the computer. I know how to auto stop a BV6 program when the screensaver starts. But is it possible, and if so how, to auto start a VB6 program when the screensaver is deactivated by say a mouse move or a key press. I would rather not have the program run when the screensaver is active.

Why you say - - - still just learning!

Thanks

How to get good system icon if system text and other items are increased by 190%?

I need system icon Exclamation on Windows 7 system with text 190%. I use:

Code:

hIcon = LoadIcon(0, IDI_EXCLAMATION)
DrawIcon Picture1.hDC, 0, 0, hIcon

Or

Code:

ExtractIconEx "c:\windows\System32\USER32.DLL", 1, hIcon, 0&, 1&
DrawIcon Picture1.hDC, 0, 0, hIcon

It gives bad quality icon. But
Code:

MsgBox "Test", vbExclamation
gives good icon.
I use manifest with <dpiAware>true</dpiAware>.
Anyone can help?

Manifest:

Code:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
>
    <assemblyIdentity
        version="1.0.0.0"
        processorArchitecture="X86"
        name="x.y.z"
        type="win32" />
 
  <asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
      <dpiAware>true</dpiAware>
    </asmv3:windowsSettings>
  </asmv3:application>

    <dependency>
        <dependentAssembly>
            <assemblyIdentity
                type="win32"
                name="Microsoft.Windows.Common-Controls"
                version="6.0.0.0"
                processorArchitecture="X86"
                publicKeyToken="6595b64144ccf1df"
                language="*" />
        </dependentAssembly>
    </dependency>

</assembly>

RDP client object server with port number

Anyone familiar with Microsoft RDP client object? I am able to launch the terminal server fine but if I need to supply a port to it, for example: server1:8080, then it would not launch. I RDP outside of my program to that server1:8080 fine. What is the settings to enable that for the rdp client object?

Hey

Hey guys im new here, was just hoping someone could point me in the right direction to create something like this: https://www.youtube.com/watch?v=hDd4F2iHcWs, but with a 3d character in 3rd person view. Can it be done in pure VB? Or DX8 , 9? I would prefer to use VB6 as im familiar with it and only want to do something very basic, what i basically want to be able to do is have a 3d world like in that video, but with a basic character that I can make armor cloths and weapons for that can be worn / wielded like runescape :)

I have beginner skills in VB6, Maybe pushing intermediate :P

Any help much appreciated thank you

Not able to update recordset

Hi ,
I have a recordset which is read from stored procedure(sp).The data in the recordset come from temporarily table in the stored procedure.

After selecting the data into the VB6, i still need to do some finishing process by updating some data to the recordset.
The problem is the recordset does not accept the new value assigned and its value is still of old value.
for example the original value of rRec.Fields("BACK_MARK_1") is "abc", i try to assign it with a new value "456".But the assign fail, it still has value of "abc"

Below is my code:
Quote:


Set rRec = modDB.StoredProcGetRecADODB(cSQL, "uspPT_BUY_OFF_ASSM_NEW", False, Trim(txtFromPTNo.Text), Trim(txtToPTNo.Text), sCustID, custID)

Dim strWaterMark As String

While Not rRec.EOF
If (IsNull(rRec.Fields("WaterMark").Value) Or rRec.Fields("WaterMark") = "") Then
strWaterMark = getFrozenWaterMark(rRec.Fields("INTERNAL_DEVICE"), rRec.Fields("BOND_NO"), rRec.Fields("MASK_ID"), rRec.Fields("DVALUE"))
rRec.Fields("BACK_MARK_1").Value = strWaterMark
Else
rRec.Fields("BACK_MARK_1").Value = rRec.Fields("WATERMARK").Value
rRec.Update
End If
rRec.MoveNext
Wend
Anyone has idea on this?Help!!
Viewing all 21376 articles
Browse latest View live


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