|
i don't know VB6, but isn't there any CType() function ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Thx for your reply, but it seems CType is a VB.Net function
I need a function that can be run in Outlook Marco
|
|
|
|
|
From memory (its been a while): CInt, CStr, CLong, CDbl, CDate
|
|
|
|
|
I have two date columns...StartDate & EndDate in my datagrid.
In my third column I need to display result of 'Start Date- End Date' in number of days
i.e. column3(no of days)=column2(enddate)-column1(startdate)
Using item template is one option but I cannot figure out how to subtract dates, calculate date and display in the subsequent item sell.
Any help anyone?got a deadline to meet
(Language = Vb.net)
Many Thanks in advance.
arty=me
|
|
|
|
|
When you subtract one datetime from another, the object that is returned is called a TimeSpan, as in
TimeSpan ts = endDate - startDate;
TimeSpan has a Days property.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
you can use
NoOfDays=DateDiff(Dateinterval.day,FirstDay,SecondDate)
where NoOfDays is of type long
Lata Agrawal
|
|
|
|
|
Introduction: I am working on a desktop application (Windows based). It is a Wizard kind of application where there are steps. You need to click on Next to go ahead and Previous to go back. On screen two I have a Data Grid which is set as read-only.
Problem: Some of the times the horizontal scrollbar of Data Grid disappears. If you double-click on Data Grid header or resize header, scrollbar appears.
What could be the cause of this, and how can we get rid of this?
- ashish
|
|
|
|
|
I am using Visual Studio Dot net 2005 for writing a program.i have to plot a graph in it from data given.i am using visual basic for this code.please help me and let me know how to plot the graph.how to make grid and all and plot graph.is there some application available tht will plot the graph automatically.
Thanks in advance.
|
|
|
|
|
|
Hello all,
Please help us with the following.
We have a winform. On click of a button, we process records which takes lot of time. The window just freezes. If you click on any other window and try to come to the same window, it does come up. When the processing is done, we want to display the same screen.
We want to display a message to the user with 'please wait' or something like that.
Any ideas or code in C# or VB.NET is greatly appreicated.
Thanks in advance.
Prasad.
|
|
|
|
|
Sound like a job for a background thread. After you launch the processing job on its own thread, you can display a modal window with your message. This will keep your UI thread unblocked so it can respond and repaint itself.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the reply.
Can anyone please give me some sample code or point to some articles which explains how to do.
Thanks,
Prasad.
|
|
|
|
|
|
Hi everyone,
I converted a project made with VB6 to VB.NET. I am now getting an error in the function header that says that I cannot pass a structure as an optional parameters. Does someone knows how I can fix it?
Here is my function:
Public Function AddInDBitems([...], Optional ByRef fColor As System.Drawing.Color = -1, [...]) As Object
Thanks in advance,
Charles
|
|
|
|
|
I think the error says it all. In the .NET Framework, Drawing.Color is a structure, not a number. Try rewriting your code to accept an Integer instead. You can convert any Color to a 32-bit value by just calling it .ToArgb() method:
Dim value As Integer = myColor.ToArgb()
AddInDBItems(..., value, ...) As Object
.
.
.
Public Function AddInDBitems([...], Optional ByRef fColor As Integer = -1, [...]) As Object
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You're completely right, why leave it in a structure when I can simply translate it into a integer. Simpler, thanks.
Charles
|
|
|
|
|
I have to edit text in TreeView control. While editing I have to restrict the maximum length of the string.
Appreciate any help in this regard.
- ashish
|
|
|
|
|
http://www.devx.com/vb2themax/Tip/18446
|
|
|
|
|
I have to edit text in TreeView control. While editing I have to restrict the maximum length of the string.
Appreciate any help in this regard.
- ashish
|
|
|
|
|
I am trying to build a file finder using vb.net. I'm new to it, so bare with me please.
All i need is sample code (that works) just to get an idea.
I've been having the worst of times looking web site after web site, and so far none of the codes that i've downloaded works!!!!! either they are not finish or they are full of mistakes.
I really apreciate it, if someone could be kind enough to show me some usefull links or just help.
|
|
|
|
|
Imports System.IO
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button1 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Button1 = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(16, 56)
Me.TextBox1.Multiline = True
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.ScrollBars = System.Windows.Forms.ScrollBars.Both
Me.TextBox1.Size = New System.Drawing.Size(568, 192)
Me.TextBox1.TabIndex = 0
Me.TextBox1.Text = "TextBox1"
Me.TextBox1.WordWrap = False
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(24, 16)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(96, 24)
Me.Button1.TabIndex = 1
Me.Button1.Text = "Search"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(600, 266)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TextBox1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Clear()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim result As ArrayList = FindFiles.FindFiles("c:\", "*.jpg")
For i = 1 To result.Count - 1
TextBox1.AppendText(result.Item(i).ToString & vbCrLf)
Next
End Sub
End Class
Public Class FindFiles
Public Shared Function FindFiles(ByVal basePath As String, ByVal searchPattern As String) As ArrayList
Dim result As New ArrayList
For Each dir As String In Directory.GetDirectories(basePath)
result.AddRange(FindFiles(dir, searchPattern))
Next
For Each file As String In Directory.GetFiles(basePath, searchPattern)
result.Add(file)
Next
Return result
End Function
End Class
|
|
|
|
|
Thanks for your help. But i'm getting this error now:
System.Unauthorized.Exception in mscorlib.dll. Access to the path "c:\systemVolumeInformation is denied.
|
|
|
|
|
Hi All
Can i compile VB.NET code at runtime? If yes how?
And how can i use it in my code?
Thanks & Regards
Sumit Domyan
|
|
|
|
|
Yes, it's possible to do. No, it's not easy to understand.
Only you can answer the third question. It all depends on what your doing.
You'll come up with lots of artciles here on CP just by searching for "Codedom".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|