HELP!:Read-only textbox & Autoexec File Icons 
Author Message
 HELP!:Read-only textbox & Autoexec File Icons

Hello all,

I am trying to create a textbox that is read-only, ie. the scroll-bar
is enabled but if the user clicks in the text portion, they are unable
to type in anything.  

Secondly, I have seen that some applications comes with a read-me file
that has an icon in their windows group.  Upon clicking on the icons,
notepad would be activated and the file would be automatically opened.
I have rather basic knowledge of VB and all I know is to modify the
WIN.INI file to include your unique extension and which program to be
associated with your file extension.  I have tried this and although my
application is activated, the file/icon which I clicked on is not
opened....  Can anyone teach me how to do this??

Regards

HY Chan



Fri, 13 Mar 1998 03:00:00 GMT  
 HELP!:Read-only textbox & Autoexec File Icons

Quote:
>Hello all,
..
>Secondly, I have seen that some applications comes with a read-me file
>that has an icon in their windows group.  Upon clicking on the icons,
>notepad would be activated and the file would be automatically opened.
>I have rather basic knowledge of VB and all I know is to modify the
>WIN.INI file to include your unique extension and which program to be
>associated with your file extension.  I have tried this and although my
>application is activated, the file/icon which I clicked on is not
>opened....  Can anyone teach me how to do this??

 You must include in your sub main() or your in your app's form load
event a:
 commandlineoptions$=Command$
and then extract from that string variable the name of the file/icon
 and use it to manage that file/icon.


Sun, 15 Mar 1998 03:00:00 GMT  
 HELP!:Read-only textbox & Autoexec File Icons

Quote:

>Hello all,

>I am trying to create a textbox that is read-only, ie. the scroll-bar
>is enabled but if the user clicks in the text portion, they are unable
>to type in anything.  

Use the SendMessage API call to set a control as read only.  Declare the
following in General/Declarations (the Declare must be on ONE LINE!!)

Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As
Integer, ByVal wParam As Integer, lParam As Any) As Long

Global Const WM_USER = &H400
Global Const EM_SETREADONLY = (WM_USER + 31)

Then, in your Form Load, use this to set a control read only - iResult must
be declared as an integer:

iResult = SendMessage(txtnumber.hWnd, EM_SETREADONLY, True, 0)

and voila - your control is read only.

--
Brought to you by:
___           .   _
|  \ _..  .* _|  |_) _ |_ | _
|__/(_] \/ |(_]  | \(_)|_)|[=\/
                             /
                                  .,.
                                 (o o)
 +---------------------------oOO--(_)--OOo----------------------------+
~!
Opinions expressed herein are my own and no sillier than yours.



Mon, 23 Mar 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. help with adding share to autoexec.bat file

2. Macro & Icon for Request Read Receipt

3. Read data from Autoexec.Bat

4. An Icon from a RES-file into a textbox

5. Help with icon files. - icons.zip (0/1)

6. Help with icon files. - icons.zip (1/1)

7. Reading a text file into a TextBox Control

8. How to read a icon from DLL file

9. Program to Read and edit icons in a DLL file

10. Drag & drop file from desktop to textbox

11. File Explorer Help - Icon/File Associations

12. Help please with read/write from textbox control - VB4

 

 
Powered by phpBB® Forum Software