VS 2008 Private Sub Output?
Jan 6, 2011
I have a private sub that I have to call in different times with different textboxes when I click a button. So I made something like this private sub [just some things to change D link into V link not really important]:
Private Sub DtoV(ByVal input As String)
Dim vlinks As String
If input <> "" Then
[code]......
View 9 Replies
ADVERTISEMENT
Jul 23, 2010
if for example i have two private sub I declared a local variable on private sub a... is there a way that private sub b could use the variable created on private sub a? Im asking because im in a problem in my app were using global variable is not an option to make the long story short
View 5 Replies
Dec 14, 2011
I am completely lost on procedures. Whats the difference bewteen Private sub and private function?
View 1 Replies
Apr 22, 2010
I'm trying to get a handle on creating my own Interfaces for a project I'm working on. I know the MSDN help shows that all member signatures will become Public when implmented, etc, etc. However, if I implement the IDisposable interface provided by the framework, comments and private members and fields show up! Not only that, but some of the methods have comments and code within!
How did they do that? And can comments, private fields and members, and predetermined code be declared as part of an interface by the average developer?
View 3 Replies
Mar 13, 2011
I am trying to call this private function, but am missing somthing, anybody point me in the right direction Private Function DL_WebPage(ByVal _URL As String) As String This is what I have tried, but with no success: call DL_webpage But this comes up with an error
View 3 Replies
Nov 5, 2010
Probably an easy question to answer...I have 9 buttons on my form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
etc. and all do the same thing so how can I merge them into the same sub so i don't have to copy and paste a bunch?
View 4 Replies
Aug 20, 2009
i made this code
VB.NET
Dim iString As String
If My.Settings.IPBank.Count = 30 Then
MsgBox("You alredy have the maximum amount of IP Addresses stored, delete one to add another.", MsgBoxStyle.Information, "Program Error")
[Code]...
I want it to check all of the items in the my.settings.ipbank which is a stringcollection. Before it adds and if it already exists in my.settings.ipbank then i want it not to add it. But it just adds when i run it. And then once its added it says: "Collection was modified; enumeration operation may not execute." But also before i run it. There is a warning saying: Function 'AddTo_IPBank' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. Is this something to do with it? I think i have the Next in the wrong place .
View 4 Replies
Dec 5, 2011
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Clicki want help for the code of a button than will enable or disablePrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
View 7 Replies
Feb 9, 2010
[Code]...
i want help for the code of a button than will enable or disable Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
View 3 Replies
Nov 25, 2010
i have window application;how can i send private message to a client that he is only can view..
View 4 Replies
Sep 4, 2009
I want to use a string array created in a different private sub in another, so I need to pass the array. How do I accomplish this task?
View 2 Replies
Nov 11, 2009
I have these list of RS-232 strings declared in my public class
Public Class TouchInterface
Dim WatchTVbtnCmd As String = "rs232command1"
Dim VolUpbtnCmd As String = "rs232command2"
Dim VolDownbtnCmd As String = "rs232command3"
Dim SystemOffbtnCmd As String = "rs232command4"
Dim RadiobtnCmd As String = "rs232command5"
Dim MusicbtnCmd As String = "rs232command6"
I then have this private sub. For the sake of this thread, what I would like to do is get the name of the label that was clicked which in the code below is already done, convert it to string (not sure if this needs to be done), this is also done in the code below. Next I want to compare the labelnamestring to all the variables in the public class to find out which one it is equal to and then disply that variable which should be my rs232 string in the message box. I have also added "Cmd" to the variable names above so I also need to work out how to add the text "Cmd" to the string to properly compare.
Private Sub Musicbtn_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles WatchTvbtn.Click, VolUpbtn.Click, VolDownbtn.Click, SystemOffbtn.Click, Radiobtn.Click, Musicbtn.Click, GardenVolUpbtn.Click, GardenVolDownbtn.Click, GardenRadiobtn.Click, GardenOffbtn.Click, GardenMusicbtn.Click, GardenMediaCenterbtn.Click
Dim labelname As Label = DirectCast(sender, Label)
[Code] .....
View 6 Replies
Jul 19, 2009
i have have a few questions about the syntax of the lan.:
1) What is the 'Get' statement and when do you use it?
2) Whats the difference between public, private, protected etc... when declaring functions and subs.
3) When would you use the overrides property?
View 4 Replies
Jul 2, 2010
When I develop a Windows Forms app in Visual Studio using C#, every control that I add to my form is by default marked as private, which is what I want.
When using VB.NET, every control is by default marked as Friend (the equivalent of internal in C#), which is not what I want.
Can I just change this default? It seems like surely it's a setting somewhere.
View 2 Replies
Mar 1, 2012
What I am trying to do: There are three powershell scripts with different time delays as shown below.I am trying to run them asynchronously in .NET and I followed this article to implement Asyncrhonous programming. Where I am stuck:The I am not able to retrieve output after the events are invoked.The scripts are being called but then the program ends and it shows "Press any key to continue" in console windows.I don't what I am missing here.
Info: JobRequest is a class that I use to pass around information keep track of jobs.
Sub Main()
OurAsyncFunctionCalling("psDelayScript2.ps1", "-arg1 4 -arg2 5", 1)
OurAsyncFunctionCalling("psDelayScript1.ps1", "-arg1 2 -arg2 3", 2)[code]......
View 1 Replies
Sep 25, 2011
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Microsoft.VisualBasic.Interaction.Beep()
System.Diagnostics.Debug.WriteLine(3 + 2)
End Sub
Why I don't see in Output window number 5 as output?
View 4 Replies
Apr 10, 2010
I have an assignment to create a multiplication table. I am attempting to use the ControlChars.NewLine however I cannot seem to get it to display all of the results. Here is the code snipet and a image of what I need to end up with, My code only displays the final product string x * 9 = y. but doesnt display 1 thru 8.
View 3 Replies
Oct 12, 2010
I'm comparing 2 files, each about 90MB. Here is my code to get the difference:
Dim bytOld() As Byte, bytNew() As Byte
Dim intHandle As Integer, i As Long
Dim u As Long
intHandle = FreeFile()
[code]....
The output (patch.dat) is over 800MB... Why is it so big? Can I make it smaller? (<10MB) How does the Patcher Here make Patch Files so small?
View 4 Replies
Oct 30, 2011
Dim myProcess As New Process()
Try
Dim s As String
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.FileName = "flac.exe"
[Code] .....
The AppendText runs and works on an initial run of the exe, but the problem is that not all output is redirected. when using parameters I get no output from the stream, but running flac.exe at the command prompt reveals output of course. Does anyone know anything about redirects and how to make the above code redirect ALL output from the exe?
flac.exe is a lossless audio codec utility. I am making a frontend for it.
View 1 Replies
May 16, 2010
don't know if anyone can help me out here. I have a combo box and basically when the user selects an option from that combo box, I would like it to produce text and an image in a group box to the right of the screen.
I have my layout set up but am unsure how to code the combo box to produce my output.
View 2 Replies
Oct 19, 2010
In my programming class, we have been set a task in which a user inputs 8 numbers, and those 8 numbers will be split into groups of 4 (therefore having 4 lots of two digit numbers). These 2 digit numbers will then translate to a specific time, day, place and city.
For example, this table below is what we have been given for city. (there are separate tables for time, day, place with different 2 digit numbers)
(Excuse the formatting)
City Code
London 11
Paris 37
[Code]...
For example, if a use inputs 11995467 I would want that to output London (being the number 11), [a PLACE = 99], [a DAY = 54], [a TIME= 67]
Bearing in mind I am a newbie, and my knowledge of VB is minimal. How would I go about doing this. It's suggested we use MOD and integer division, but I don't see how it can work.
View 5 Replies
Aug 15, 2011
I am running a stored procedure and presenting the data back to users in a simple datagridview. I'm unable to figure out a way to filter my data through the SQL side, so I wanted to see if I could filter data through the datagridview. Basically my sql query returns back values of "activity" that are either added or deleted, and I only want to present data back to users that are "added.' Is there a way to do this by filtering the contents of the datagridview?This is what I have in my codebehind for the page for both the SQL connection string, and the stored procedure. I'm assuming that this would be where I would filter the information.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles oncallsubmitButton.Click
Dim dt As New DataTable
Dim da As New SqlDataAdapter
Dim cmd As New SqlCommand
[code].....
View 5 Replies
May 2, 2011
I am pulling different information from the same file at two different times: 1) The first time, I pull information that is inserted into a combobox. I need to use the combobox as a filter for when I pull the information a second time. 2) I pull different information from the same file, and it is outputted into a datagridview table. I already have a filter in place when the information is pulled the second time, and I was wondering if I could add to that filter or if I have to make another filter? The filter (or filters) will be used to filter the information in the datagridview before it is outputted in a chart.
This is the code for binding the combobox to the information
Dim cnRange As String = "provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source='" & strFileName & "';" & _
"Extended Properties=""Excel 8.0; IMEX=1; HDR=No;"""
[code].....
View 3 Replies
Oct 30, 2011
I am working on a frontend. I use Process.Start("file.exe", "arguments") to start the process.
Is there a simple way to get output by the process returned in a textbox?
The exe which is launched is a console program.
View 2 Replies
Oct 23, 2010
I am working on a program that takes 12 numbers that the user inputs and calculates the total and average but every time I run it it comes out to be like 6.5 and numbers like that.
' Store the starting values in total and count.
sngTotal = 0
intCount = 1
[code].....
View 2 Replies
Apr 1, 2010
I know it is possible to have more than one audio output device attached to a computer. For example, my home machine has a soundblaster card as well as stereo speakers attached via a USB M-Audio controller. I know that windows and other applications can select which output device to use... I use the sound card for normal Windows sound, but I use my M-Audio output when mixing music in Cubase.The question is, from inside my own program, I need to be able to detect what audio devices are available, show the user the list and let him choose one, and then use that output device for all audio output generated by the program.
It would also help if I could determine which audio output device is being used by Windows.
Oh, almost forgot, I am using Microsoft.DirectX.AudioVideoPlayback.Audio to play mp3 files.
View 3 Replies
Nov 20, 2010
i am using this code for sending an image to print:
Private Sub PrintToolStripMenuItem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles PrintToolStripMenuItem.Click
Dim TmpPrntPicDoc As New System.Drawing.Printing.PrintDocument
AddHandler TmpPrntPicDoc.PrintPage, AddressOf TmpPrntPicDoc_PrintPage
Dim TempPPD As New System.Windows.Forms.PrintPreviewDialog
[Code]...
View 3 Replies
Aug 31, 2011
Below is the code that I have while reading the DGV column and let me know what I'm doing wrong, here.
[Code]...
View 1 Replies
Feb 9, 2010
I have a sql stored procedure with an output parameter. I'm just trying to read the output parameter in my code and I just cannot get it to work. The error I get is: "Procedure or function 'GetFolderData' expects parameter '@RootName', which was not supplied."
It looks like I am supplying this but it's not working.
Here is my stored procedure:
ALTER PROCEDURE [dbo].[GetFolderData]
(
@RootID int,
[Code].....
View 1 Replies
May 31, 2012
i'm using lineInput to read a text file but get a problem with a certain record.it shows [code]I've changed the encoding to utf8, ansi, ... but nothing helps. Anybody an idea what could be the cause?It only does this with the first record in the file.
View 3 Replies