|
Hi,
Is it possible to display data from a comma seperated value file (CSV) into a datagrid in VB.Net?
Any possible ideas with be great.
thanks.....
|
|
|
|
|
Of course it is. You'll have to open the file and parse it up using the Split function, putting each line/field into a DataTable object yourself. This DataTable can then be used as a DataSource in a DataGrid.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for your help.......
|
|
|
|
|
Hi,
Could someone tell me how I could overlay a file's icon with my own overlay icon?
For example; I would like to set my overlay icon on a selected file and be able to remove the overlay when I want.
Any Help would be greatly appreciated.
thanks,
Zenly
|
|
|
|
|
I really need some help on this one...
I'm trying to make an application that I will be stored on a cd-rom.
This application will help me to execute .exe and .zip files
from the same cd-rom as my application.
But I can't find out how to execute files from the application path.
I remember that I have seen this kind of code somewhere. But that would
take me hours or even days to find that again.
I've tried using Shell and the Environment class but with
no good results.
So what should I do? Any tips?
|
|
|
|
|
Try: System.Windows.Forms.Application.StartupPath
|
|
|
|
|
Hi guys,
I'm programming in VB6.
I'm using a SSTab and a datagrid to show some informations of a table of a sql database. The number of Tabs i can have depend of the number of records i have in the table. (example: 5 records found, so i'll set my SSTab.Tabs propertie to 5 at runtime. "Like SSTab.Tabs=5")
And the information is displayed in the datagrid. But, when i have more then 1 record, i must create the datagrid at runtime too, so that i create a datagrid control array at design time and use this code at runtime to create my datagrid :
Load MSGrid1(TabIndex)
TabIndex is a variable that contains the number of Tab of the SSTab.
My problem is : The MSGrid1 created at runtime still appear in the first tab of the SSTab.
My question is how can i create the grid at runtime and make appear in the tab i want it to appear at runtime using VB6 codes?
Sincerely yours
Marc
|
|
|
|
|
Hello there
I want to make right to left window and it should display cross,Maximize and minimize buttons on the left side instead of right. this can be done in message box.. check this code on any event
Dim msg As MessageBox
msg.Show("Right ", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.RtlReading)
I need this type of right to left alignment on form
any solution ????
Rizwan Bashir
|
|
|
|
|
Rizwan Bashir wrote:
I want to make right to left window and it should display cross,Maximize and minimize buttons on the left side instead of right.
[...]
I need this type of right to left alignment on form
I guess this is what you're looking for:
Creating Mirrored Windows Forms and Controls[^]
Best regards
Dennis
|
|
|
|
|
Thanks Dennis it solved my all the problems including treeview,listview and offcourse the form
Best Regards
Rizwan Bashir
Rizwan Bashir
|
|
|
|
|
|
Hi, the question i got is: how can i use the lame_enc.dll in a program i'm developing in vb.net, 'cause i cannot add it as a reference (because is not a COM component)???
If a have to call the dll using functions, could you please give me a little example about the way that i should do it?? or if there's another way (easier), well even better!!
|
|
|
|
|
victor_ba85 wrote:
Hi, the question i got is: how can i use the lame_enc.dll in a program i'm developing in vb.net, 'cause i cannot add it as a reference (because is not a COM component)???
Take a look at this:
C Sharp MP3 Compressor[^]
Even if you don't know C# it could still be a starting point to figure out how to use the DLL. You could also just integrate the project in your own solution.
Best regards
Dennis
|
|
|
|
|
How to create array of controls like labels or combobox at run time, so that when the user input an integer, it will create the controls dinamically. Can this be done? Thanks in advance.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
its party time...... do the steps
' Form Level declaration
Friend txt() As System.Windows.Forms.TextBox
'Form Load
redim txt(0)
' on specified event where you need to display do this
' I am displying ths stuff in for loop on a panel control just to keep
' the scroll bar if it exceed the displying limit
put your for loop around this..... where count if the loop counter.
Me.txt(Count) = New System.Windows.Forms.TextBox
Me.txt(Count).Location = New System.Drawing.Point(left, top)
Me.txt(Count).Size = New System.Drawing.Size(200, 20)
Me.txt(Count).Text = count
' the panel control
pnlControls.Controls.AddRange(New System.Windows.Forms.Control() {Me.txt(Count)})
top = top + 21
txt(Count).Visible = True
txt(Count).MaxLength = 10
' if you want to put the events also paste this
AddHandler txt(count).MouseDown, AddressOf FunctionName
AddHandler txt(count).MouseUp, AddressOf FunctionName2
' remember the Function should be defined like this
Private Sub FunctionName(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
Msgbox "I am a happy man"
End Sub
Rizwan
|
|
|
|
|
Oops sorry Rizwan, I`m not using VB.NET. Could you tell me in VB6. Thanks
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
goodmast3r wrote:
I'm not using VB.NET. Could you tell me in VB6.
Guess you're on your own with that one. Although it is possible in VB 6 it isn't nearly as elegant as in VB.NET. Anyway, maybe this will help to get started:
Introducing Visual Basic 6 [pdf][^] (page 6)
Best regards
Dennis
|
|
|
|
|
goodmast3r wrote:
How to create array of controls like labels or combobox at run time, so that when the user input an integer, it will create the controls dinamically. Can this be done?
In addition to what Rizwan already wrote you might want to call Control.SuspendLayout()[^] and Control.ResumeLayout()[^] depending on how complex your operations are. I used two loops just to point out the two steps of the initial creation of the objects and a later manipulation.
Dim newLeft As Integer = 0
Dim newTop As Integer = 0
Dim counter As Integer = 0
Dim newButton As Button
Dim myButtons(4) As Button
Me.SuspendLayout()
For counter = 0 To myButtons.Length - 1
newButton = New Button()
newButton.Left = newLeft
newButton.Top = newTop
myButtons(counter) = newButton
newLeft += 32
newTop += 32
Next counter
Me.Controls.AddRange(myButtons)
Me.ResumeLayout()
For counter = 0 To myButtons.Length - 1
myButtons(counter).Text = "Button #" & (counter + 1).ToString("d")
Next counter
Best regards
Dennis
|
|
|
|
|
How to build array of controls like label or textbox at run time? When the user give an integer of 5 it will create array of labels, consist of 5 labels. Can this be done? Please help. Thanks in advance
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
I will assume you are working in VB as control arrays are not yet available in VB.Net.
To load a control without an existing control on the form do the following.
Set ctlTxtName = Me.Controls.Add("VB.TextBox", "txtName", Me) To load a control to a control array, will need to already have an existing control array on the form. eg. Text1(0)
Dim x as integer
For x = 1 to 5
Load Text1(x)
Next x
Michael
I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious.
Vince Lombardi (1913-1970)
|
|
|
|
|
Im trying to implement a splash screen in VB.NET but am having problems acheiving the result I'm after.
Basically what I want is to start with a splash screen with a logo and at the bottom of that splash screen show the progress of the program loading. Eg Connecting to Database, Loading XYZ etc at the bottom of the splash screen.
My problem is I can get the splash screen to show OK but all the things being done (such as connecting to DB loading form etc) all seem to be done before the actual logo is painted on the screen. Therefore you just see a white box where the splash screen is and dont get to see the progress of the code. I originally was firing all the code on the load event of the splash screen but then i changed it to the paint event but i still cant get it to work.
Any help would be muchly appreciated.
Thanks,
Daniel.
|
|
|
|
|
try using a thread to do your background work (db loading etc).
|
|
|
|
|
Thanks for the reply. I havent used threads before. Should i initiate this thread on the form load event or on the paint event?
Any help would be appreciated.
Daniel.
|
|
|
|
|
on the form load event. Something like this (it may be wrong since im so used to c#) -
<br />
dim mythread as new system.threading.thread(new system.threading.threadStart(doWork))<br />
mythread.isbackground = true<br />
mythread.start()<br />
then -
<br />
public sub doWork()<br />
'do db background stuff here<br />
end sub<br />
|
|
|
|
|
Start your application with a startup module
Module Mdl_StartUp
Public FrmSplash As New Frm_Splash()
Sub Main()
Splash_AantalStappen = 4
Splash_ToonScherm(True)
Dim FrmMain As New Frm_Main()
Application.Run(FrmMain) End Sub
End Module
Module Mdl_Slpash
Public Splash_AantalStappen As Int16 = 1
Dim StapNr As Int16 = 0
'Toont of verwijdert het splash screen
Public Sub Splash_ToonScherm(ByVal ShowIt As Boolean)
If ShowIt Then
FrmSplash.Show()
FrmSplash.Refresh()
Else
FrmSplash.Close()
End If
End Sub
Public Sub Splash_Init()
With FrmSplash
.L_CopyRight.Text = Proginfo.CopyRight
.L_ProgressText.Text = ""
.L_Versie.Text = "Versie : " & Proginfo.Major.ToString & "." & Proginfo.Minor.ToString & "." & Proginfo.Build.ToString
.L_CopyRight.Text = Proginfo.CopyRight
End With
End Sub
'Waarde van de progressbar in het splash screen
Public Sub Splash_ToonProgress(Optional ByVal Tekst As String = "NOTEKST")
StapNr += 1
If StapNr > Splash_AantalStappen Then
FrmSplash.Close()
Else
Dim ProgressWaarde As Int16 = StapNr * (100 / Splash_AantalStappen)
With FrmSplash
.PB.Value = ProgressWaarde
.PB.Refresh()
If Tekst <> "NOTEKST" Then
.L_ProgressText.Text = Tekst
.L_ProgressText.Refresh()
End If
End With
End If
End Sub
End Module
On the SplashScreen you create a progressbar (PB) and The Labels
In the load of FrmMain you can update the progressbar by calling Splash_ToonProgress
I hope this will help you
|
|
|
|