9 Replies - 993 Views - Last Post: 27 September 2013 - 03:19 AM Rate Topic: -----

#1 Rayner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-September 13

Common Control Dialog Display Problem

Posted 26 September 2013 - 12:34 AM

I am having a common control dialog developed in vb6.

We will usually open excel files using this dialog. The lase opened excel will be displayed when we try to open again.

Suppose I am opening a program named "TestProgram.xls", I load it and close the program. Next time when I try to open, I can only find "stProgram.xls", The "Te" is not visible. However even though my dialog box is big enough, it is only partially displaying the name. A sample screenshot is attached.

I tried both the command to open the program CommonDialog.Action = 1 and CommonDialog.ShowOpen. Both are displaying partially.

Also it is not reproducing in every machine. Somehow there must be something to display the full text. Please help me doing it.

Attached image(s)

  • Attached Image


Is This A Good Question/Topic? 0
  • +

Replies To: Common Control Dialog Display Problem

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 303
  • View blog
  • Posts: 1,793
  • Joined: 26-March 09

Re: Common Control Dialog Display Problem

Posted 26 September 2013 - 12:40 AM

A couple of points/questions.

Is this dialog control shown from VBA (VB inside Excel) or is it from a VB6 program?

Also, it would be useful to display any code you have in reference to how you populate the control properties and display the dialog control.

Please use the CODE tags as described in the background of the entry window.
Was This Post Helpful? 0
  • +
  • -

#3 Rayner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-September 13

Re: Common Control Dialog Display Problem

Posted 26 September 2013 - 12:58 AM

It is from VB6 project.

If ("" <> LastPath) Then
        If Left(getBaseFileName(LastPath), 1) = Chr$(0) Then
            CMDlg.filename = GetPath(LastPath) + "\" + "*.xls"
        Else
            CMDlg.filename = LastPath
        End If
    End If
    
    ' File up common dialog box
    On Error GoTo CancelError
   
    CMDlg.Action = 1



where CMDlg is the common dialog object.
Was This Post Helpful? 0
  • +
  • -

#4 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 303
  • View blog
  • Posts: 1,793
  • Joined: 26-March 09

Re: Common Control Dialog Display Problem

Posted 26 September 2013 - 01:14 AM

Where does last path get populated?

Have you tried debugging this through, or even putting out lastpath to screen or a messagebox?
Was This Post Helpful? 0
  • +
  • -

#5 Rayner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-September 13

Re: Common Control Dialog Display Problem

Posted 26 September 2013 - 01:44 AM

Last path is filled like below. It is displayed in the common control dialog using "CMDlg.filename = LastPath". But the text is not displaying fully even if the combo box in common control display is big enough.

If InStr(1, LastPath, Chr$(0)) <> 0 Then
        LastPath = Left(LastPath, InStr(1, LastPath, Chr$(0)) - 1)
        ' Check for file open type, if All Files is selected then show all files format else show only files of ".xls" format.
        If OpenType <> AllFiles Then
        LastPath = GetPath(LastPath) + "*.xls"
        Else
            LastPath = GetPath(LastPath) + "*.*"
        End If
    End If


Was This Post Helpful? 0
  • +
  • -

#6 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 303
  • View blog
  • Posts: 1,793
  • Joined: 26-March 09

Re: Common Control Dialog Display Problem

Posted 26 September 2013 - 08:23 AM

Sorry, maybe I misunderstood you (been a long few days)....

Are you saying that LastPath does contain the correct information, but just doesn't display it correctly on screen? So, if you clicked Open in the example screenshot you gave, it would open the file?
Was This Post Helpful? 0
  • +
  • -

#7 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 303
  • View blog
  • Posts: 1,793
  • Joined: 26-March 09

Re: Common Control Dialog Display Problem

Posted 26 September 2013 - 09:21 AM

Check out this post - looks identical to yours from 12 months ago on another forum...
Was This Post Helpful? 0
  • +
  • -

#8 Rayner  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 26-September 13

Re: Common Control Dialog Display Problem

Posted 27 September 2013 - 01:38 AM

I checked the thread you mentioned. Even in that there is no solution :( But yes it is a Microsoft bug for windows, but atlease somehow I am trying to workaroud it.
Was This Post Helpful? 0
  • +
  • -

#9 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 303
  • View blog
  • Posts: 1,793
  • Joined: 26-March 09

Re: Common Control Dialog Display Problem

Posted 27 September 2013 - 02:44 AM

Appreciate that, was more wondering whether it was your post from 12 months ago as the code looks remarkably similar.

Was just thinking that if you'd been searching for that long, likelihood is you're not going to find an answer. :)

Can't say it's something I've come across before (or noticed), but will have a play.
Was This Post Helpful? 0
  • +
  • -

#10 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 303
  • View blog
  • Posts: 1,793
  • Joined: 26-March 09

Re: Common Control Dialog Display Problem

Posted 27 September 2013 - 03:19 AM

This might not be the way you want to go, but have a look at this link.

It creates a subclassed dialog, which has been modified to add extra controls, but you don't need to do this.

I tried writing a long filename to the filename property and it displays OK.

Might be worth a look, but it certainly won't be a drop in and run as is.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1