|
yes it is
but i want coding to use it
|
|
|
|
|
hence code!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hello,
I have user control that has been placed on many tab pages. The tab control is not part of the user control. The user control consists of text boxes and combo boxes
The user can add new tabs and enter the data into it the user control and click save which is also part of the user control. However, if they decide to save on a previous tab and then click save it will save the contents of the text boxes and combo boxes that are on the last tab.
This is because the text boxes and combo boxes are taken from the last ones that are created.
How can I select another tab and click save, and save the contents of those text boxes and combo boxes on that tab?
my code for the save button in the user control.
Code:
<br />
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click <br />
Try <br />
Dim rowsAffected As Integer = Me.TA_IncidentTask1.UpdateTask(_incidentID, Me.cboSupportType.Text, Me.cboUsers.Text, Date.Now.ToLocalTime(), Date.Now, Me.txtTaskDetails.Text, Date.Now, Date.Now.ToLocalTime(), Me.cboStatus.Text, String.Empty, String.Empty, Me.txtCompletionNotes.Text, _taskID) <br />
Catch ex As Exception <br />
MessageBox.Show(ex.Message) <br />
End Try <br />
End Sub<br />
Many thanks for your help,
Steve
|
|
|
|
|
Hello,
I am using this code to loop through a tab control and get the name of the tab.
However it always fails with an index error on the last tab, even though it does get the name of the tab on the last one.
Can anyone see if there is anything wrong with the code below.
Code:
Dim i As Integer = 0
For i = 0 To Me.TabControl1.TabCount
taskID = Me.TabControl1.TabPages(i).Name
Next i
Many thanks,
Steve
|
|
|
|
|
Hi there,
Do the following:
Dim i As Integer = 0
For i = 0 To Me.TabControl1.TabCount - 1
taskID = Me.TabControl1.TabPages(i).Name
Next i
Regards, Werries
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
Hi there,
you need to use TabCount - 1 as the first index of the tabs is zero.
Alternatively, you can use this:
<br />
For Each t As TabPage In Me.TabControl1.TabPages<br />
taskID = t.Name.ToString()<br />
Next<br />
Hope this helps,
Daniel
|
|
|
|
|
|
Hi,
i have been playing with some code that creates Control array labels that display dates down in a column in a Windows Form, but i am having trouble with removing Control array labels if a date range changes.
How do i remove a Control Array Label? in the case where the quantity of labels required where to be reduced by the Control Form control selecting the start and end dates.
some of the code that i have been playing with is attached below.
************************************
************************************
' remove the day array. 'this part doesnt work in my case..
For pd As Integer = 0 To 12
Me.Controls.Remove(lblDayArray(pd))
Next
strDayRow = datAStartDate.ToString("dddd,dd MMMM")
'using the label DayArray create days in rows
For i As Integer = 0 To DayDiff
lblDayArray(i) = New Label
Me.Controls.Add(lblDayArray(i))
With lblDayArray(i)
.TextAlign = ContentAlignment.MiddleRight
.BorderStyle = BorderStyle.None
.Location = New Point(intDInitLocationX, intLocationY)
.Size = New Size(intDInitSizeL, intInitSizeH)
.Text = strDayRow
.Name = "lblDay(i)"
End With
intLocationY = intLocationY + intSpacingY 'increments to next day
datAStartDate = dpStartDateRange.Value
datAStartDate.AddDays(1)
Next
Microsoft Visual Basic .NET (2003) version 7.1.6030
Microsoft .NET Framework 1.1
Regards,
Colin
|
|
|
|
|
After finally getting somewhere with reading XML, I ran into a problem. I want to list all the feed titles in a listview, and then when I click on a title, I want to view the the "Description" tag corresponding to the selected item. What I am having trouble with is determining which item I have clicked so that I can display the corresponding description. Here is what I have now:
Private Sub ListView1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
Dim XMLDoc As XmlDocument
Dim NodeListTitle As XmlNodeList
Dim NodeListText As XmlNodeList
Dim XmlDocNode As XmlNode
XMLDoc = New XmlDocument()
XMLDoc.Load("C:\feed.xml")
NodeListTitle = XMLDoc.SelectNodes("/rss/channel/item/title")
NodeListText = XMLDoc.SelectNodes("/rss/channel/item/description")
'Determine what item is selected and display it's description
For Each XmlDocNode In NodeListText
PostBox.Text = XmlDocNode.InnerText
Next
End Sub
How should I go about getting the selected item and determining it's description tag? And is this the proper way to read an XML file? Thanks for the help!
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
hi there,
i have a problem with following coding. it is a coding of saving text file. and its saving the text file but when the file open in notepad then the all the lines merge together
eg. write 4 lines in textbox
12343
1232
222435
4343
and save
when open in notepad ,it look like this image
http://img213.imageshack.us/my.php?image=errorka4.jpg[^]
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim fName As String
Save.ShowDialog()
fName = Save.FileName
If Save.FileName <> "" Then
Dim fSave As New StreamWriter(fName)
fSave.WriteLine(Text1.Text)
fSave.Flush()
fSave.Close()
End If
End Sub
someone know what is the cause of it?
|
|
|
|
|
|
|
How to calculate time difference in hours between two dates, let's say 01/01/01 12:00 and 02/02/07 7:00?
|
|
|
|
|
Just use the DateTime.Subtract function, like so:
Dim FirstDate As New DateTime(2007, 2, 2, 7, 0, 0)
Dim SecondDate As New DateTime(2001, 1, 1, 12, 0, 0)
Dim FinalDate As TimeSpan = FirstDate.Subtract(BDayNow)
Hope this helps!
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
You can subtract DateTime values, the result is a TimeSpan. You can use the TotalHours property to get the time difference. Example:
Dim startTime as DateTime = new DateTime(1, 1, 1, 12, 0, 0)<br />
Dim endTime as DateTime = new DateTime(7, 2, 2, 7, 0, 0)<br />
Dim diff as TimeSpan = endTime - startTime<br />
Dim hours as Double = diff.TotalHours;
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi there,
You can use the 'DateDiff' function, realy easy to work with.
Regards, Werries
A programmer's life is good... or is it?? Ek dink nie so nie!
|
|
|
|
|
I heard on this forum that .NET 2.0 has an integrated capability to compress folders to zip file. How to use this and what is the syntax? Can you give me an example code? I would like to compress two folders "C:\temp" and "D:\foo" into a single zip-file that would be saved into "E:\zipfiles".
|
|
|
|
|
|
Hi,
I have two forms say Default.aspx and popup.aspx
Default.aspx cotains a textbox whereas popup.aspx contains a text area.
When user enters more than 10 characters in a textbox of default.aspx,popup.aspx should open and all characters of text box should get transfer to textarea of popup.aspx.
The code that i had written using javascript is as follows:
function limitText(){
var textboxvalue = document.getElementById("limitedtext").value;
if(textboxvalue.length == 10)
{
alert(textboxvalue);
window.open("popup.aspx?value=textboxvalue","","resizable=1,width=600,height=200")
}
}
And This is textbox code:
******Retrieving value in popup.aspx********
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim strQuery As String = ""
strQuery = Request.QueryString("value").ToString()
TextArea1.Value = strQuery
End Sub
But When i put break point and check the value of strQuery, it is showing
"textboxvalue" instead of characters typed in the textbox.
I will be very grateful if you tell me that how should i pass the value through the url from the line:
window.open("popup.aspx?value=textboxvalue","","resizable=1,width=600,height=200")
Thanks
Shyam (new to javascript)
|
|
|
|
|
This is an ASP.NET question.
Pass the data on the URL.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I want to buy vb6.0. Where can I find the cheapest and fast deal for it.
ciacia
|
|
|
|
|
The only place you're going to find VB6 is on eBay. VB6 hasn't been available for purchase retail for about 5 years now.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Can anyone tell me what is the syntex to open a HTML file in my documents? (\My Documents\123.html)
When I click on the button, I want the HTML file appear.
What's wrong with the coding below?
Dim sr As StreamReader = New StreamReader("\My Documents\123.html")
Dim line As String
Do
line = sr.ReadLine()
Console.WriteLine(line)
Loop Until line Is Nothing
sr.Close()
Thanks for your help!
|
|
|
|
|
The main problem you would have here, is that you don't have a proper path to the file. You can use Environment.SpecialFolder to get the path to the current MyDocuments folder.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I don't think so because the html file is located at My Documents.
May I know how to use Environment.SpecialFolder?
Thanks for your reply!
|
|
|
|