|
jady84 wrote: Does anybody know where or how I can find it?
It is the same as any other menu. There is no difference. You just add the items and fill in the names and wire up the methods.
jady84 wrote: Also I would like to make my file executable so that it can run on any other computer even though they do not have vb express 2005 installed.
They just need to download the .NET Framework 2.0 and your exe will work.
|
|
|
|
|
Hi,
Im a little new to this, how do i actually create the menu bar (what do i have to click and drag) and how would i add items so that when file is clicked upon, the options 'open' and 'close' appears for the user to click on.
Also I have installed the .Net framework 2.0 currently my file is saved as a vb file, do i need to save it as an .exe file or something? if so how do i do this?
thanks in advance
Jaidev
|
|
|
|
|
jady84 wrote: Im a little new to this,
Maybe the best thing to do first is to pick up a book (or look up a resource on the Net) on VB.Net and you are set.
|
|
|
|
|
jady84 wrote: Im a little new to this, how do i actually create the menu bar (what do i have to click and drag)
A MenuStrip perhaps? (Why don't you create a new project, drag it on to a form and experiment with it?)
You might also want to get a book such as Step-by-step.... or ...by Example or something similar.
jady84 wrote: Also I have installed the .Net framework 2.0 currently my file is saved as a vb file, do i need to save it as an .exe file or something? if so how do i do this?
Yes, it need to be an executable file. This is created automatically when you compile the application. You'll find it in a sub folder of the project. Either Release or Debug depending on how you built it.
|
|
|
|
|
Hi All,
Plz help, Here anybody tell me how can i get query execution time through vb or SQL Server.
Regards:
SMK
|
|
|
|
|
what about
Dim timeStampBegin As DateTime
Dim timeStampEnd As DateTime
Dim timeDiff as TimeSpan
timeStampBegin = DateTime.Now()
... query ...
timeStampEnd = DateTime.Now()
timeDiff = timeStampEnd.Substract( timeStampBegin )
solidIT.de - under construction
Components for Microsoft .Net
audittrail, objectcomparer, deepcopy and much more ...
|
|
|
|
|
Sir/Madam,
I am facing problem in selecting the data in the listview.There are two columns in the listview.I have to select both the columns and rown under it.For that I am using the following code.
For count as integer=0 to listview1.itens.count
Listview1.items.item(count).selected=true
next
But It select only one column , the data under it.
I am using the another way to get the desired output .By that is not working too.
For count as integer=0 to listview1.itens.count
Listview1.items(count).selected=true
next
Please help.
Thanks and Regards
Pankaj
|
|
|
|
|
try:
me.listview1.multiselect=treu
|
|
|
|
|
I use visual basic 2005
I have a listview on my form whit a datasourse from the dataset
so i wil see the data frorm the dataset in the listview.
When i do that the first column of the listview is empty how is that possible
I create a class called listview.vb with following code
Imports System.Data.SqlClient
Public Class ListViewData
Public Sub FillListView(ByRef MyListView As ListView, ByRef myData As SqlDataReader)
Dim lvwColumn As DataColumn
Dim itmListItem As ListViewItem
Dim shtCntr As Short
For shtCntr = 0 To myData.FieldCount()
lvwColumn = New DataColumn()
MyListView.Show()
Next
Do While myData.Read
itmListItem = New ListViewItem()
For shtCntr = 0 To myData.FieldCount() - 1
If myData.IsDBNull(shtCntr) Then
itmListItem.SubItems.Add("")
Else
itmListItem.SubItems.Add(myData.GetValue(shtCntr))
End If
Next shtCntr
MyListView.Items.Add(itmListItem)
Loop
End Sub
End Class
and the code for the form is:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myCon As SqlClient.SqlConnection
Dim sqlCmd As SqlClient.SqlCommand = New SqlClient.SqlCommand("SELECT * FROM contacten")
Dim myData As SqlClient.SqlDataReader
Dim itmListviewItem As New ListViewItem
Dim lvhHelper As ListViewData = New ListViewData()
myCon = New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\contacten.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")
Try
myCon.Open()
sqlCmd.Connection = myCon
myData = sqlCmd.ExecuteReader
lvhHelper.FillListView(ListView1, myData)
myCon.Close()
Catch eSql As System.Data.SqlClient.SqlException
MessageBox.Show(eSql.ToString)
End Try
End Sub
Can someone tell wth is wrong ??????
|
|
|
|
|
i found the problem by myself:
Do While myData.Read
itmListItem = New ListViewItem()
itmListItem.Text = "First culums output" (this is what i write between and it works)
For shtCntr = 0 To myData.FieldCount() - 1
|
|
|
|
|
the folowing works perfect. I you want only columns you want to select from your datbase, write ("SELECT [fistname],[backname] from contacten") inplace of ("SELECT * FROM contacten")
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim myCon As SqlClient.SqlConnection
Dim sqlCmd As SqlClient.SqlCommand = New SqlClient.SqlCommand("SELECT * FROM contacten")
Dim myData As SqlClient.SqlDataReader
Dim lvhHelper As ListViewData = New ListViewData()
myCon = New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\contactpersonendata.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")
Try
myCon.Open()
sqlCmd.Connection = myCon
myData = sqlCmd.ExecuteReader
lvhHelper.FillListView(ListView1, myData)
myCon.Close()
Catch eSql As System.Data.SqlClient.SqlException
MessageBox.Show(eSql.ToString)
End Try
End Sub
---------------------------------------------------------------
End the class:
Imports System.Data.SqlClient
Public Class ListViewData
Public Sub FillListView(ByRef MyListView As ListView, _
ByRef myData As SqlDataReader)
Dim lvwColumn As ColumnHeader
Dim itmListItem As ListViewItem
Dim strtest As String
Dim shtCntr As Short
MyListView.Clear()
For shtCntr = 0 To myData.FieldCount() - 1
lvwColumn = New ColumnHeader()
lvwColumn.Text = myData.GetName(shtCntr)
MyListView.Columns.Add(lvwColumn)
Next
Do While myData.Read
itmListItem = New ListViewItem()
strTest = IIf(myData.IsDBNull(0), "", myData.GetValue(0))
itmListItem.Text = strTest
For shtCntr = 1 To myData.FieldCount() - 1
If myData.IsDBNull(shtCntr) Then
itmListItem.SubItems.Add("")
Else
itmListItem.SubItems.Add(myData.GetString(shtCntr))
End If
Next shtCntr
MyListView.Items.Add(itmListItem)
Loop
End Sub
End Class
|
|
|
|
|
hello evryone,
i have an existing application and now i need to update it in order to handle different regional setting.
can someone help me on this, or give a sample codes, or much better a dll.
thanks...
sherwin
|
|
|
|
|
hello sherwin,
with .net it is easier as you think. the gui (your forms) is representes through resx-Files and the code is in a vb-file. you can see this by activating "show all files" on top of the project explorer.
for example you have your forms in english language and you want to support german, then you only have to select each form an set the property "localizeable" to "true". after that you select the langauge and the vs-editor automaticly creates an additional resx-file to your form. you can change the ui as you like > the code file remains the same ...
but look at these links for detailed information:
www.codeproject.com/dotnet/Localization.asp
http://www.microsoft.com/globaldev/getwr/dotneti18n.mspx
http://www.google.de/search?hl=de&ie=ISO-8859-1&q=.net+localization&meta=
solidIT.de - under construction
Components for Microsoft .Net
audittrail, objectcomparer, deepcopy and much more ...
|
|
|
|
|
Sir/Madam,
Problem is ,I am not getting to know the advantage of using the Property(Get and Set).
First i Declare the variable like
Dim str as string=""
Then , I am declaring the property as follows.
Public property funt() as string
Get
func = str
End Get
Set(byval value as string)
str = value
End set
end Property
I mean , First I am declaring the variable named str , then i am using the property(get,set).I question is y should i use the property.Isn't this just the increase in line of code.Isn't the declaration
dim str as string = ""
enough.
Please help.
Thanks and Regards
Pankaj
|
|
|
|
|
One advantage - it means you can set a breakpoint to know when your variable is accessed
another - you should try to provide only get accessors whereever possible, thus protecting your class from external tampering
another - you don't have to set a value here, you can do all sorts of other stuff, or get a value from a control.
It just gives you more control over what you expose, how it works, and how you can follow it.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
One reason is isolation, which is a key part of object orientation.
You isolate the storage of the data from the action of accessing the data. That means that you can change the way that the data is stored without having to rewrite all code that uses the data.
Another reason is protection, which is another key part of object orientation.
You can make the propery read only if it shouldn't be changed directly. You can add logic to verify that the value is legal before setting it. You can add locking for thread safety.
The increase of lines in the code is not a problem, apart from the added typing. In the release compile the code in the property will be optimized away if you haven't added any extra logic.
If you were afraid of typing you wouldn't use Visual Basi-Cobol anyway.
---
Year happy = new Year(2007);
|
|
|
|
|
And another reason. Validation. The class can protect itsefl from invalid data comming by checking the data before it's stored in the variable.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I want to get the .txt and .Doc files. but i wrote the code only displaying the txt file.But it wont display the .Doc files.
I select the Doc and txt fileNames in Listbox.but File's Contents has to display in Richtextbox.
so I've written the code for(.txt) files only.But i need (.Doc) file's contents also.So How to get the (.Doc files Contents).So pls some one Help me......
Private Sub ListBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox3.SelectedIndexChanged
Dim myFile As System.IO.FileInfo
Dim fileInfo As String
Dim myFileName As String
Dim stream As StreamReader
Dim input As String
myFileName = ListBox3.SelectedItem.ToString
myFile = New System.IO.FileInfo(fileName:=myFileName)
fileInfo = myFileName.Length.ToString
stream = File.OpenText(myFileName)
input = stream.ReadLine()
Console.WriteLine(input)
RichTextBox1.Text = input
stream.Close()
End Sub
Pls Some one Help me.....
Thanking you
somasundarak
Thanking You,
somasundaram
|
|
|
|
|
A doc file is not a text file. It's a custom file format that you can't read in .NET. You can control Word to read it for you, via COM, and perhaps .NET. But you can't read a doc on a computer without Word installed.
somagunasekaran wrote: ListBox3_SelectedIndexChanged
I'd recommend using more sensible variable names.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
how to get the .Doc filename's contents....
some one help me... anybody having samplecode...
Pls tel me....
|
|
|
|
|
Nothing is more astounding to me than people who ask a question, then reject the answer because they don't like it.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I have a setting called bckColor which holds the color for the form I'm using. I want to be able to change that color (and save it) using another page. When the form loads, I use me.backcolor=my.settings.bckColor to set the form's backcolor up.
The issue I am having is that the form doesn't always load the color from the My.Settings location. If I had red in the value, run the program and then stop it, manually change the value to blue and run it again, I get red as my backcolor.
Am I missing any additional setting in the my.setting area? in the form properties?!
Please help me.
Thanks.
|
|
|
|
|
Hi,
Me.BackColor = SomeOtherCode.BackColor is always a bit tricky, because even if you are sure that SomeOtherCode is running when your form loads, SomeOtherCode.BackColor may nevertheless not be in memory at that exact moment. Best is to pass SomeOtherCode.BackColor to a public variable when your application starts, then you can easily change the value of that variable on the fly (if necessary). Then Me.BackColor = PublicVariableMyBackGroundColor should work whenever your form loads.
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Sir/Madam,
Can I programically find out whether the particular table exist in the database or not.
My database is MS-Access
I am trying to find the table constructed in the database.
Thanks abd Regards
Pankaj
|
|
|
|
|
just try this
SELECT * FROM MSysObjects
solidIT.de - under construction
Components for Microsoft .Net
audittrail, objectcomparer, deepcopy and much more ...
|
|
|
|