SIMPLE Questions Thread!

Posts 6175 of 82 · Page 5 of 6
Quote Originally Posted by [PA]nts View Post
I just saw this thread, so I though't I'd ask.

How do I change this name:

And, is it possible to put a picture behind there? Where the gray space is?
Click the form, not a label, not a textbox, not a button, they gray space. Then scroll down, and there will be a box that says "Text" then "Form1" will be next to it. Change form1 to anything you want.

To get a picture, do the same thing, but scroll all the way up until you see background color, below that will be background image. Select the image you want.
Programatically: Me.Text = "Whatever"
MugNuf ily. <3
Does someone know the code to copy the application .exe file without knowing it's path(for the windows directory for example)?

I'm thinking of something like this:
Code:
[php]Dim AppPath As String = Application.StartupPath 'Detects app path and makes it a string
... My.Computer.FileSystem.CopyFile(AppPath, "C:\Windows") ' copy it from the current path to the C:/Windows directory.[/php]


But I dont know why this doesn't work and causes the application to crash when i build it...
Quote Originally Posted by omanel View Post
Does someone know the code to copy the application .exe file without knowing it's path(for the windows directory for example)?

I'm thinking of something like this:
Code:
[php]Dim AppPath As String = Application.StartupPath 'Detects app path and makes it a string
... My.Computer.FileSystem.CopyFile(AppPath, "C:\Windows") ' copy it from the current path to the C:/Windows directory.[/php]


But I dont know why this doesn't work and causes the application to crash when i build it...
[php]

dim appname as string = "putyourprojectnamehere.exe"
dim myapp as string = (Application.StartupPath & "\" & appname)

My.Computer.FileSystem.CopyFile(myapp, "C:\WINDOWS\" & appname)

[/php]

Hope that helps.
isn't it like

my.computer.filesystem.copyfile(application.startu ppath & "\name", "C:\Windows\whatever.exe")
This is the same just with 2 strings declared xD
Quote Originally Posted by Blubb1337 View Post
This is the same just with 2 strings declared xD
I know But I started replying to it before I saw your post so i was like ohshit and made it look different :P
Did it take you 20 minutes to post that?

My post - 34 mins ago
Your post - 14 mins ago

???
xD

Wai no em es en? (msn -.-)
Quote Originally Posted by Blubb1337 View Post
Did it take you 20 minutes to post that?

My post - 34 mins ago
Your post - 14 mins ago

???
xD

Wai no em es en? (msn -.-)
No l2read nubcake, I didn't realise you'd posted a solution 'cos it wasn't wrapped in php wrappers so I thought it wasn't solved, then I was about to press post and saw that yours was the same. No em es en cos i'm watched tee vee, very sorreh.
and....on topic

Both will work if the file is in the startup path,(even though, yes they are the same) if the user is referring to a file that is not in the start up path, a recursive search first then move, it may take a while, but will work effectively.

So Perform a Recursive Search then once file is located, store file location , use found location to move file.
Quote Originally Posted by NextGen1 View Post
and....on topic

Both will work if the file is in the startup path,(even though, yes they are the same) if the user is referring to a file that is not in the start up path, a recursive search first then move, it may take a while, but will work effectively.

So Perform a Recursive Search then once file is located, store file location , use found location to move file.
It looks like it's a little to advanced for me to for me to do it yet, i am a beginer.

Anyways thanks blubb1637 and J-Deezy, NextGen1 I will keep that in mind so I can use it later when I have a little bit more knowledge.

/Happyness explosion
it Wordked! !
Quote Originally Posted by omanel View Post
It looks like it's a little to advanced for me to for me to do it yet, i am a beginer.

Anyways thanks blubb1637 and J-Deezy, NextGen1 I will keep that in mind so I can use it later when I have a little bit more knowledge.

/Happyness explosion
it Wordked! !
No problemo, glad it worked :P
Hey again, quick question!

How can I set a ToolStripSplitButton to only allow one Item checked at a time..
so there won't be two items checked at the same time?
I'm thinking of
[php]If ToolStripMenuItem1.checked = True Then
ToolStripMenuItem2.Checked = False
ToolStripMenuItem3.Checked = False[/php]
but I have a lot of Menu Items and it would be a lot of work, is there any where I can change this instead of doing it like that?
Quote Originally Posted by omanel View Post
Hey again, quick question!

How can I set a ToolStripSplitButton to only allow one Item checked at a time..
so there won't be two items checked at the same time?
I'm thinking of
[php]If ToolStripMenuItem1.checked = True Then
ToolStripMenuItem2.Checked = False
ToolStripMenuItem3.Checked = False[/php]
but I have a lot of Menu Items and it would be a lot of work, is there any where I can change this instead of doing it like that?
Just loop through every toolstripmenuitem and then check which item to check and which to uncheck. I've created a simple sub for this, add it to your form:

Code:
Sub enable1DisableRest(ByVal ItemToEnable As ToolStripMenuItem)
        For Each n As ToolStripMenuItem In Me.Controls
            If Not n Is ItemToEnable Then
                n.Checked = False
            Else
                n.Checked = True
            End If
        Next
    End Sub
Now call it with inputting just the ToolstripMenuItem you want to enable !!

For Example:

Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        enable1DisableRest(ToolStripMenuItem1)
    End Sub
Hope this helps !!
Posts 6175 of 82 · Page 5 of 6
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?