User Profile

Collapse

Profile Sidebar

Collapse
dbanning
dbanning
Last Activity: Feb 5 '08, 05:01 PM
Joined: Apr 17 '07
Location: UK
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dbanning
    started a topic delete part of a string

    delete part of a string

    I am trying to remove part of a string and place it into another variable

    the string is a filename

    eg

    "C:\help\demo\s ample.txt"

    I want to remove and resave into a new string just the file name i.e "sample.txt "

    my thinking was to count backward to the point where the last "\" was and store this integer value and then delete all parts before....
    See more | Go to post

  • dbanning
    replied to Placing a grid on a vb form
    I am unsure as to what you mean could you give a bit more detail on you suggestions it would be much apprieciated.

    All my searches have come up blank Im guessing it is not a popular problem....
    See more | Go to post

    Leave a comment:


  • dbanning
    started a topic Placing a grid on a vb form

    Placing a grid on a vb form

    I there anyway of placing a grid on a VB form that shows individula pixels. The same style of grid as which you can turn on and off in a paint program such as Photshop.

    I could just draw it but My hope was to be able to turn it on and off and resize it with the form etc.

    Any help would be much apprieciated.
    See more | Go to post

  • dbanning
    replied to Saving form and contents as bitmap
    My mistake the application.wai t statement only works in vb macros for excel and not normal vb the Now refers to the current time which is an excell function.

    Thats the problem with writing to many macros.

    I decided to use the sleep command

    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    then just placing sleep X in the code where X is time in milliseconds....
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Saving form and contents as bitmap
    Form2 is deffinately the active window I am doing

    Form2.show
    Form1.hide
    before the code runs

    My program does a do while loop to capture multiple shots of the form with a square moving across the do loop shifts this squares position and saves each time. All pics are captured correctly except the first one. This shows that form2 is the active window but the delay to open it is causeing the bitmap to be...
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Saving form and contents as bitmap
    Your welcome to use the code I have tried the original version and my new verison with the saving of the file and both work perfectly.

    Very useful code i will make note of it incase i need to use it again.

    I also try holding alt while clicking the command button and it does not have any effect on the code and still does what it is suppose to do.

    My program has linked the save file path to a text box on...
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Saving form and contents as bitmap
    you code works perfectly thanks again, I have tuned it up abit and added in some extra bis and now it works exactly as i want.

    Code:
    Option Explicit
    
    Const VK_MENU = 18
    Const VK_SNAPSHOT = 44
    Const KEYEVENTF_EXTENDEDKEY = &H1
    Const KEYEVENTF_KEYUP = &H2
    
    Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal
    ...
    See more | Go to post
    Last edited by Killer42; Apr 18 '07, 10:18 PM. Reason: Added [CODE] tag

    Leave a comment:


  • dbanning
    replied to excel cell format
    You can do this from excel directly by setting the wdth to autofit selection. Than it will autoamatically change to fit the contents or you can use


    Selection.Colum ns.AutoFit
    Selection.Rows. AutoFit
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Saving form and contents as bitmap
    That is very useful I will attemp to use this later once i return from work thanks for going to the effort of looking into this for me it is much apprieciated.

    I will let post an outcome later...
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Saving form and contents as bitmap
    Thanks I will look into that, What about sendkey command is there any way to use this to press alt and print screen and then pull the image from the clipboard and save it.

    I have tried this a bit but think I must need a timer to release the keypress alo if I code

    Sendkey "Alt + print screen",true

    for some reson numlock comes on so obviously im guessing print screen is not the name vb gives to...
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Saving form and contents as bitmap
    Thanks I did not know that shortcut I might be able to do something with that, Thanks againg all help is apprieciated....
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Check box codes
    Thats true good code perhaps you can answer my post that im stuck with.

    http://www.thescripts. com/forum/thread633852.ht ml

    any help would be good...
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Check box codes
    Not sure how this will work you are saying that label.visible can either be 1 or 0 but visible areguments can either be true or false?

    surly you will just get an error...
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Check box codes
    For what you wanted to do not really that is the easiest way to do it.

    You original code failed as you required the label to change value only when another item changed in this case the cheack box.

    It is therefore a conditional statement the if statement does something if this condition is met so if your checkbox was 1 meaning checked it does the statement below if it wasn't so either a 0 or 2 meaning unchecked and grayed...
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Check box codes
    This is true its just a third variable that you can set up incase you require it. There is some way to enable it but I can not remember how not a control I use regularly.

    It would be useful in logic calculations which is probably what it meant for.
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Saving form and contents as bitmap
    Sorry I am using VB6 to do this
    See more | Go to post

    Leave a comment:


  • dbanning
    replied to Check box codes
    check boxes can either be value 0,2,1 meaning unchecked, greyed or checked.

    Thats what I'm aware of and the method I use setting ture and false might work but I would guess not as there are three possible variables and not two.
    See more | Go to post
    Last edited by dbanning; Apr 17 '07, 07:10 PM. Reason: Mistake

    Leave a comment:


  • dbanning
    replied to Check box codes
    Vb will work its way down you statements from top to bottom you asking check title value has no relation to the the title disapering

    If I understand you correctly you need an if statement to get it to work.

    Eg

    If chkTitle.Value = 1 then
    lblTitle.Visibl e = False
    else
    lblTitle.Visibl e = True
    end if

    Dan
    See more | Go to post

    Leave a comment:


  • dbanning
    started a topic Saving form and contents as bitmap

    Saving form and contents as bitmap

    I am trying to save the contents of a form as a bitmap and am unsure how to do this. I can use the savepicture command to save the form as a bitmap but the contents is not intact as you would expect. There is 1 picture box on the form which I wish to save with the form so really a full screen shot of the form.

    Taking a screen shot and saving it won't do it either as the form is only a section of the screen say 640 X 480 and is centred...
    See more | Go to post
No activity results to display
Show More
Working...