|
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 ...
|
|
|
|
|
Sir/madam,
Thanks for ur kind attention.But how i will get to know that whether that table exist or not.
Thanks and Regards
|
|
|
|
|
no prob
SELECT COUNT(*) AS TABLE_EXISTS FROM MSysObjects WHERE Name = 'Forms'
- and now you only have to replace "Forms" in the where clause with the table you want to check
- if the TABLE_EXISTS field is bigger than 0 (zero) then the table exists otherwise it doesn't
solidIT.de - under construction
Components for Microsoft .Net
audittrail, objectcomparer, deepcopy and much more ...
|
|
|
|
|
Hello All!
I have two applications in a solution. ServerA and ClientB lets say. I need to be able to open a form on ClientB from ServerA. SoI'm using a Filewatch to do this. First I create a file in the watched folder. I'm doing this by a button click event on ServerA.
Dim TimeStamp As String = Guid.NewGuid.GetHashCode<br />
Dim TempFile As String = "C:\PlayC\Qtr2\"<br />
Dim ext As String = ".out"<br />
Dim FileName As String = TempFile & TimeStamp & ext<br />
Dim fs As New FileStream(FileName, FileMode.Create)<br />
fs.Close()<br />
End Sub
The my Filewatch is like this on ClientB.
AddHandler NKWatch.Created, AddressOf NKWatch_Created<br />
Try<br />
NKWatch.Path = "C:\PlayC\Qtr2"<br />
NKWatch.Filter = "*.out"<br />
'' NKWatch.IncludeSubdirectories = False<br />
NKWatch.EnableRaisingEvents = True<br />
Catch ERR As Exception<br />
MessageBox.Show(ERR.Message)<br />
End Try
Then the response once a file gets created in the folder.
Public Sub NKWatch_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs)<br />
Dim frmFour As New frm4th<br />
<br />
Me.Hide()<br />
frmFour.Show()<br />
frmFour.GetUID(Me)<br />
Application.DoEvents()<br />
End Sub
So when my form shows up, it displays, but then freezes up on me. I use to get a white screen when the form came up, but I put in Application.DoEvents, and that seem to help.
I even tried just a plain form with a couple of buttons.
But if I try a message box, it works perfect.
Am I missing something? Any thougts on this, and how I may get this to work? I try to get debug it, but I can't find anything. The server A form is pretty simple, the clientB form has alot of stuff going on, that why I tried a simple blank form. But the same results.
I have two clientB forms, prety much the same, except diffrent labels for the buttons.
Thanks!
Rudy
|
|
|
|
|
Hi Rudy,
I have had problems myself with hiding and showing forms, and I found that me.hide() sometimes seems to act a little like me.close() , and therefore doesn't always nicely handle subsequent code.
rudemusik wrote: Public Sub NKWatch_Created(ByVal sender As Object, ByVal e As System.IO.FileSystemEventArgs)
Dim frmFour As New frm4th
Me.Hide()
frmFour.Show()
frmFour.GetUID(Me)
Application.DoEvents()
End Sub
Just a wild guess, but you could try to move Me.Hide() after Application.DoEvents()
If it doesn't help, it shouldn't hurt either.
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Hi Johan!
I tried that. I even tried just to show the form, without hiding it. Same thing. Still trying to figure it out.
Thanks for the reply!
Rudy
|
|
|
|
|
Dear all,
Some of most popular program (e.g., meetro) has no proxy setting.
I want to use that program with proxy server. But I don't know how to redirect IP
to proxy server. Can I developed a program with VB for that problem?
Please help me...
(stup!x...)
|
|
|
|
|
Well, how this is done depends on the application. There's two possibilities.
The first is if you can change the IP that your application is using. If so, then you have to write your proxy server as both a server AND a client for the kind of server that your app attaches to. The server accepts the connection from the application and forwards the request to the REAL server the application was trying to connect to. This forwarder is actually a client of the REAL server. The response comes back from the server and the client side forwards the responds to your proxy's server side. Get it?
Now, if you can't change the IP the app uses, you have a MUCH more difficult problem. Now, instead of a proxy server, you're stuck writing a packet sniffer, just like any network protocol analyzer. You have to use a 3rd party library, like WinPcap, to capture the packets as they go down the network stack, modify the packets to redirect them to a new server IP.
Since your even asking this question, and the language you've picked for it, tells me that you have a very limitied knowledge of how TCP/IP communication works. Make no mistake, both of these projects require an ADVANCED level of knowledge of how your application works and how IP communication works.
No, I don't have an example of either of these types of apps.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thank you for your answer DAVE.
(stup!x...)
|
|
|
|
|
Hello,
I want to hide a column in a datagrid.
This is my code below that works, but isn't there a better way to do this.
<br />
ds = objComponents.RefComponentsTypes_selAll()<br />
Me.dgvComponents.DataSource = ds.Tables(0)<br />
Me.dgvComponents.Columns("AssemblyID").Width = 0<br />
Thanks in advance,
Steve
|
|
|
|
|
You can set the width to zero.
Or you can just delete the column all-together.
Or you can get a new view of the DataSet and not include that column in the view, then bind the DataGridView to the new DataView.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi
i m using datagirdview in my vb.net(winforms)-2005 application.
i m validating each cell in "datagridview_CellValidated" procedure. and after validating each cell i wnt to set focus on that cell so i wrote following code in above procedure but it doesnt set focus on that cell to which im validating.
code----->
DGCustDept.CurrentCell.DataGridView.Focus()
or
Me.DGCustDept.CurrentCell = New DataGridCell(e.rowindex, e.columnindex)
Please tell me wht shuld i do?
priya
|
|
|
|