Function For String Fill?
Sep 24, 2009Is there a function like String.Fill(CharacterToRepeat,HowManyTimesToRepeat)? I'm wanting to add multiple spaces before a string of text.
View 2 RepliesIs there a function like String.Fill(CharacterToRepeat,HowManyTimesToRepeat)? I'm wanting to add multiple spaces before a string of text.
View 2 RepliesPublic Function readinisettings() As String()
im inis(5) As String
inis(0) = sxml.DocumentElement.Item("rts485ip").InnerXml
[code]....
Im trying to set a forms size to fill my desktop screen is any function that does this or do you have to set the form size manually depending on the screen size each time ?
View 5 RepliesWhen I declare two datatables and fill them both from a datatable returned by a function in class, that when i filter the one it seems to filter the other aswell?
For example:
I declare the datatable and initiate my class:
Dim DatatableOne As New Datatable
Dim DatatableTwo As New Datatable
Dim MyClass As New MyClass
I then call the function that returns a datatable and apply it to datatable1 and 2 Then fill two DataGrids with the table:
DatatableOne = MyClass.GetTable()
DatatableTwo = MyClass.GetTable()
DatatableOne.DefaultView.RowFilter = "Name = 'Tom'"
[CODE]...
For some reason i don't understand but both grids end up with the filtered data?
I'm following this tutorial: [URL]..except I'm connecting to my own data source - a MS Access database.This is the query I have setup with the dataset:
SELECT Terminal_ID, SUM(Transaction_Quantity) AS Total
FROM tblTransaction
WHERE TransactionType_ID=3 and Transaction_DateTime>[@fromdate]
GROUP BY Terminal_ID
The debug fails immediately because it needs the extra parameter so I change the code from:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'tetrisDataSet.tblTransaction' table. You can move, or remove it, as needed.
Me.tblTransactionTableAdapter.Fill(Me.tetrisDataSet.tblTransaction)
[code].....
The error I get on build is:Too many arguments to 'Public Overridable Overloads Function Fill(dataTable As tetrisDataSet.tblTransactionDataTable) As Integer
...I gave it the extra parameter, so what gives? Something special I need to do as it's a datetime field?
I have 1 string : abc @#ABC.xyz123ZYX
Now I need to encode the string:
The encoding alphabetic characters,
CODE:
With this string, after encoding, the result is: zyx @#ZYX.cba123ABC
About Function Encrypt and Function Decrypt?
Some programs implement command parameters, Like my favourite computer game - Crysis - has them and windows media player has them.But how could i implement them in VB.NET..I want to have a component of my program built as a seperate exe - so it can be an Optional component.But of course the seperate exe, on load, needs data passing to it.So i need something like Process.start("Componentname.exe", "/StartDL <Suchandsuchastring>)/StartDL will need to call a function, and the string that it uses will be given to the function to initiate a download?
View 9 RepliesThe following output produces a string with no closing xml tag. m_rFlight.Layout = m_rFlight.Layout + "<G3Grid:Spots>" + Me.gvwSpots.LayoutToString() + "</G3Grid:Spots>"
This following code works correctly
m_rFlight.Layout = m_rFlight.Layout + "<G3Grid:Spots>" + Me.gvwSpots.LayoutToString()
m_rFlight.Layout = m_rFlight.Layout + "</G3Grid:Spots>" 'add closing tag
What's going on here, what's the reason the first example isnt working and the second is?
The gvwSpots.LayoutToString() function returns a string.
this is my code
Dim str As String = "str1,str2"
Dim array() As String = str.Split(",")
Dim MyListOfTextBoxes() As TextBox = {TextBox1, TextBox2, TextBox3}
[Code]....
i have 5 textboxes. i want to fill just textbox1 and textbox2 with array value. because no i have to word.but when i run the code "str1" repetition on textbox1,textbox2 and textbox3.
In VB.NET, I would like to increment a number in a string and have it zeroed filled. Here is the sample string with the 5 digit number: R00099 What I would like returned after incrementing it by one: R00100
View 5 RepliesI would like to get fill a String array with all the images found within a directory.Till now i use the following to get all the images with jpg format Dim List() as string = Directory.GetFiles(Path, "*.jpg")Now i would like to extend it and get all the image formats.Could i use the directory.GetFiles combined with an "ImageFormat enumeration"?
View 2 RepliesWinfom, intellsense remind me configurationManager wrong.This code is from asp.net, how can I change it?
unction GetData(ByVal queryString As String) As DataSet
' Retrieve the connection string stored in the Web.config file.
Dim connectionString As String =
[code]......
Its my Code
CODE:
The problem is TextBox fill Successfully but String can not be filled. it shows empty.
string function(s) to change only first letter of string to Upper Case?
View 7 RepliesI have combo boxes for user choices on the form. One combo box for name, one for phone number and one for email. I first created that to allow user to make select in each combo box. As more "user friendly" interface, I I would like to associate the selection made on cmbBxReqstrName with corresponding phone number and email and cause the phone number and email combo box to "auto fill" in their respective combo boxes based on the selection in the cmbBxReqstrName. It was suggested to me that a two dimesional array might be an option. I read up on arrays but don't quite comprehend the coding part to access the data in the array and fill that to the combo box or I guess use the index from array to index the combo box list.
View 5 RepliesI want the Function to accept List(Of String), Array & String and similarly return List(Of String), Array & String respectively. The Function simply adds a string (month) to the input collection. I just want to use it for string, array and list with needing to think of conversions.
[Code]...
If I have a string Metal is hot : Metal length is 5 cm ; Metal is red. I want to get the sub string that is talking about length: hence I want to extract "Metal length is 5 cm".
[Code]...
I need to remove an instance in a class for which I also created a dictionary with a string key type. Like this...:
vb
'Declare dictionary
Public PersonsList As New Dictionary(Of String, Person)
'At the bottom of frmMain.vb
[code]....
As you see, I end having 120 instances of the class Person, each assigned with a string key consisting in "student1" to "student120".
At other parts of the program I repeatedly refer to PersonsList("student" & n) to set values at those class entries, mainly with a For n ... Next block.
Now... I need a routine to remove one of those instances for good, including its entry at the dictionary, so my first bet is this...:
vb
Public Sub ExpellStudent(ByVal student_index As Integer)
PersonsList.Remove("student" & selected_student_index)
students_count -= 1
End Sub
I assume this is good enough to remove the KVP at the dictionary AND the class instance proper... right?Well, even if that is ok, I foresee one problem... Let's say I removed "student46". Next time I run a For n = 1 to students_count I would bet that I'll receive an exception due to having a gap at "student46" KVP... and that without saying that students_count will be 119, so it will never reach "student120".In short, I need a way to reassign the KVP of the now 119 Person entries, so they're consecutive again (I don't care about them changing their string key values), so I still could use my For n = 1 to students_count ... Next blocks without problems... but I cannot figure out how.
I just want to display data of a single column from an oracle table into a datagridview or a listbox for readonly with no requirements to make changes to it. Simply display the information.What is the best way forward... To used DATAADAPTER or DATAREADER.s DATAGRIDVIEW SLOWER TO FILL THAN a LISTBOX.i am using the following code to fill datatgridview but for some odd reasons at time it is slow to display the data. I want to use listbox instead
Dim ds As New DataSet
Dim adp As OracleDataAdapter
adp = New OracleDataAdapter("select customer_name from customers")
[code].....
What i am trying to do is call functions from a string that I created The example would be:genoutput is a string I made to concatenate the function calls when a certain combo box item was selected...
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)Handles Button2.Click
Select Case ComboBox1.SelectedItem
[code].....
Is it possible to make your own function for a String? So you could do this:
Dim String a = "C:Windows"
if a.Exists then 'do something
Is it possible to make your own .Exists?
I've made a function in C# to create a random string, but I wanted to convert it to VB.NET, unfortunately my knowledge of Visual Basic is much less than my knowledge of C#.
Here is my VB.NET function:
CODE:
As you will see, its not much different from my C# version, except that since VB can take an optional parameter, I allow the user to select what characters to use in the string, or just use the default ones.
Here's the C# version of my function:
CODE:
Again, there's not much different, but the part I'm really struggling on is the conversion between what is the 12th line of VB code, and the 13th line of C# code. I didn't really know how to convert it to VB.NET (as I said, my knowledge of it is very limited), so I used an online converter. The result of the online converter runs with no errors, however when I try to call the function, no string appears.
In short, this C# code works fine:
CODE:
However, this VB.NET code doesn't work:
CODE:
How could I fix my VB.NET code?
I have an XML file with a list of tasks to be executed. One of the elements of the XML file is funcName (function name), which is the name of a function to be executed in my Visual Basic.NET application (v4).I can retrieve the string name of the function, but how do I go about running it? I have two Class files, GUI and DISP.[code]
View 2 RepliesI'm just wondering how I could have a Textbox, execute "scripts" through it? Like say my Textbox.Text is "MsgBox("test")", how can I execute that function?
View 2 RepliesI just want to randomly fill the label with text, I'll put some of the code I need to know what to add to get it, I don't need a click event or anyting just the random part.[code]....
View 1 RepliesI have a class in this class i call a function which should return some string the class connects to an ftp server and list the directory and returns the filenames of the dir.
Code:
Public Function GetFileList(ByVal host As String, ByVal username As String, ByVal password As String, ByVal currentdirectory As String) As List(Of String)
Dim oFTP As FtpWebRequest = CType(FtpWebRequest.Create(host & currentdirectory),
[CODE]..........
So this should return all filenames of that directory
like:
Data1.xml
Data2.xml
Data3.xml
Now i have a form with a listview where i want to call this function and get the files of the "olist"
Code:
Return oList
HOW CAN I DO THAT? i mean how would my sub look like on my form where i want to call that function?
I am trying to call C++ function from VB.Net code which returns string using PInvoke, but it is returning only single character.
C function Declaration
extern "C" __declspec(dllexport) LPSTR Get_GetDescription(HANDLE)
C function Defination
LPSTR Get_GetDescription(HANDLE resultBreakDown){
[Code].....
Actually i need to rotate or swap this item like below :-
[Code]...
Here is my code for the string comparison function
Public Function CmpKeys(ByVal oldkey As String, ByVal newKey As String) As Boolean
Dim cmpText As Integer
[code]....
My question is whenever I compare "alt+ctrl+w" with "alt+ctrl+W" it tells me that both the strings are the same, but as you can see that both of these strings are not equal because it got small 'w' and the other one is 'W', how come both of these strings are equal?
It works for the First Replace but not for the Earnings Replace, I want to check a label and if its have a First Character E I need to be replace with
[Code]...