Results 1 to 22 of 22

Thread: Text Contrast VB 6.0 [RESOLVED]

  1. #1

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Resolved Text Contrast VB 6.0 [RESOLVED]

    Hello,

    I have a HScroller that I need to attach to the text1 message contrast.

    Can anyone help me with this?

    Also I have this shell command that I am using like this
    Code:
    Private Sub Command2_Click()
        Shell "notepad.exe", vbNormalFocus
    
    End Sub
    How can I get this to open up a .txt file from C:\mytxtfile.txt? (In a notepad.exe window?

    Thanks bunches!
    Stilekid007
    Last edited by stilekid007; Apr 19th, 2005 at 03:56 PM.

  2. #2
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: Text Contrast VB 6.0

    Quote Originally Posted by stilekid007
    Hello,

    I have a HScroller that I need to attach to the text1 message contrast.

    Can anyone help me with this?

    Also I have this shell command that I am using like this
    Code:
    Private Sub Command2_Click()
        Shell "notepad.exe", vbNormalFocus
    
    End Sub
    How can I get this to open up a .txt file from C:\mytxtfile.txt? (In a notepad.exe window?

    Thanks bunches!
    Stilekid007
    I don't understand your contrast question... but the one for notepad:

    VB Code:
    1. Shell "notepad.exe ""C:\mytxtfile.txt""", vbNormalFocus
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Text Contrast VB 6.0

    VB Code:
    1. Private Sub Command1_Click()
    2. Shell "notepad.exe c:\myfile.txt", vbNormalFocus
    3. End Sub

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Text Contrast VB 6.0

    This will work

    VB Code:
    1. Shell "notepad.exe c:\myfile.txt", vbNormalFocus

  5. #5
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: Text Contrast VB 6.0

    Quote Originally Posted by Hack
    VB Code:
    1. Private Sub Command1_Click()
    2. Shell "notepad.exe c:\myfile.txt", vbNormalFocus
    3. End Sub
    Quote Originally Posted by dglienna
    This will work

    VB Code:
    1. Shell "notepad.exe c:\myfile.txt", vbNormalFocus
    Beat ya' both!

    I would go with the quoted filename (just in case the filename has any space in it.)
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Text Contrast VB 6.0

    Quote Originally Posted by Mc Brain
    Beat ya' both!
    We need an icon that sticks out its tongue at you.

    Actually, Mc Brain has a good point about the possible spaces in the file name. It would be wise to go with his suggestion.

  7. #7
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: Text Contrast VB 6.0

    Another hint for stilekid007: When I say FileName I refer to the whole path and file's name itself. So, if your file has no spaces, but it's located in C:\Documents and Settings\MyProfile\My Documents\ ... you would need to surround the name with quotes. Otherwise, it won't work.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  8. #8
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: Text Contrast VB 6.0

    Quote Originally Posted by Hack
    We need an icon that sticks out its tongue at you.

    Actually, Mc Brain has a good point about the possible spaces in the file name. It would be wise to go with his suggestion.
    The icon you're looking for is (or at least, that's what its tooltip says)
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  9. #9

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Re: Text Contrast VB 6.0

    Hello to everyone! And thank you! MrBrain's code worked very well!

    So thank you for that!
    ______________________
    Shell "notepad.exe ""C:\mytxtfile.txt""", vbNormalFocus
    ______________________

    Ok, well with the Message contrast.. I got mixed up.. I ment message Transparency! Sorry about that! I need Text1 to have a HScroller to slide to the right to make the message transparancy lighter and to the left to make it more visible..

    Is that explained enough? If not just ask!

    Thank you again to all of you!

    Stilekid007

  10. #10
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Text Contrast VB 6.0

    You should search for transparency. As long as you're not using Windows 98, you should be set. Here, I found one for you!

    http://www.vbforums.com/showthread.p...t=transparency
    Last edited by dglienna; Apr 18th, 2005 at 07:07 PM.

  11. #11

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Lightbulb Re: Text Contrast VB 6.0

    Hello,

    Thank you for searching for the transparency forums! However I also searched and nothing came up for my specific problem.

    See I have a hscroller1 that slides left and right. When this slider is to the left the transparency would be low and when it is to the right it would be visible..

    Is there any way to do this?

    Thank you and have a great day!
    Stilekid007

  12. #12
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Text Contrast VB 6.0

    I think I have the same example. I can't get it running, although I'm using XP and this says its for W2K. I used to have something with a slider that controlled opacity, but can't find it again. I even compiled it think that might be it.
    Last edited by dglienna; Apr 18th, 2005 at 10:22 PM.

  13. #13
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Text Contrast VB 6.0

    Quote Originally Posted by stilekid007
    When this slider is to the left the transparency would be low and when it is to the right it would be visible..
    Quote Originally Posted by dglienna
    I used to have something with a slider that controlled opacity
    I thought it was only possible to set the alpha level of a form, not controls. I tried doing it to pictureboxes but couldn't get it to work.

  14. #14
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Text Contrast VB 6.0

    well, the form wasn't transparent, but the slider disappeared entirely, and wouldn't come back. a flag said that it was back, but it wasn't. i saved the project anyways, maybe someone wants it?

  15. #15
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Text Contrast VB 6.0

    Yeah, post it.

    Does it change the opacity of the form or the control?

  16. #16
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Text Contrast VB 6.0

    Not sure what it's supposed to do, as I couldn't get anything working.

    Let me know if you do. It recognizes that the OS is sufficient.
    Command1 makes the slider disappear, I think Command2 is supposed to bring it back, but it doesn't. Command3 seems to say whether the slider is visible or not, but says true when it isn't visible. Kind of a mess.

    Post back if you figure it out. I need a good sample.
    Attached Files Attached Files

  17. #17
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Text Contrast VB 6.0

    Dunno what was wrong with that one. There seemed to be a lot of redundant code.

    Anyway, here is a quick example that I just knocked up. Should be sufficient to demonstrate both getting the OS version and setting the window opacity.
    Attached Files Attached Files

  18. #18
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Text Contrast VB 6.0

    Very cool. That's the way that it's supposed to work. Half the code, also.
    I guess I won't mention where I found it. It wasn't here.

    Thanks.

  19. #19
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Text Contrast VB 6.0

    I can't seem to get it to work with anything except forms. I'll keep trying though

  20. #20

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Talking Re: Text Contrast VB 6.0

    Hello guys! That looks like a very sweet opacity slider... That is what I am looking for except a slider that makes the text in the forms transparent... Don't bother if its too much.. Its not really the most immportant thing in my prog. I just thought I would see if anyone had any ideas... I should probably not even have it in my program but it would be more for entertainment... Its a very nice example though penagate! Thank you! I might add that code exept have it as a command button to completly hide the form (Without a slider) So thanks!

    And thank you dglienna for your helpfull posts!

    So yea thats what I will do.. Put that code to a command button instead of a slider and it will be perfect!

    Thank you to all! and have a great day!
    Stilekid007

  21. #21
    Addicted Member Max_aka_NOBODY's Avatar
    Join Date
    Jul 2004
    Location
    Amman, Jordan
    Posts
    179

    Re: Text Contrast VB 6.0

    Maybe it would make sense to simulate transparency by changing the text color. If that's the case, use something like this:

    VB Code:
    1. Private Sub sldOpacity_Change
    2.  
    3. 'Min=0
    4. 'Max=255
    5. 'This is to be used on a white form.
    6. 'Otherwise you'll need to customize the colors.
    7.  
    8. label1.ForeColor=RGB(sldOpacity.Value, sldOpacity.Value, sldOpacity.Value)
    9.  
    10. End Sub

  22. #22

    Thread Starter
    Hyperactive Member stilekid007's Avatar
    Join Date
    Apr 2005
    Location
    DUDE! I'm your neighbor! HELLO!!!
    Posts
    388

    Re: Text Contrast VB 6.0

    Hello,

    Max_aka_NOBODY... That is a very simple solution that I think might work! See you could have it set to the same color as the background form if you wanted it to be invisible... Thanks for your suggestions!

    Stilekid007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width