have another problem trying to solve again I am trying to add a line into a listbox in this format time item (10), so, e.g. 4:00 Item1(10) So when the next item is added into the listbox and so on, it will look something like this
4:00 Item1 (10)
4:10 Item2 (15)
4:25 Item3 (20)
The time is a Date, and the minutes to add on is extracted with regex. I was able to add the items like above with hardcoding but ain't successful when i try to do it in a shorter way.
I have a tabgroup with 2 tabs. During runtime, I wish to add new ones. Though I can get the tabs added, I cannot seem to add the ListBox that is supposed to go with it. In the code below, I added '*' to indicate a line I added to try and fix the problem, but (obviously) don't work.
Dim newTab As New TabPage("Group " + g.userLabel.ToString()) newTab.Name = "Tab" + g.userLabel.ToString TabGroups.TabPages.Add(newTab)
I am currently working on some tools and I am having some troubles adding new lines in a listbox.
vb.net For i = 0 To lstFiles.Items.Count - 1 Process.Start("C:UT2004Systemucc.exe", "compress " & lstFiles.Items.Item(i)) If IO.File.Exists(lstFiles.Items.Item(i) & ".uz2") Then
[Code].....
The meaning of this code is that if the file exists, it will add a new line called Success below the dragged fileline. If the file doesn't exist it will create a new line called Fail below the dragged fileline.
how to insert data to a datagrid at run time, like values for the columns will be entered in text boxes and after cliking a button it should get inserted in to the data grid and have to be displayed immediately in the grid.
i have a timer that counts down from 2 hours, its part of a 2 hour time limit for a computer. but if the application was to fail it would restart from 2 hours again. which isnt good, so it needs to restart where it left of. so far i have got it to save the current time on the countdown timer to a reg key. but i need to put that time back hope that made sense. here is the part of my code
Dim LLT As DateTime Dim HReg1 As Object HReg1 = CreateObject("Wscript.shell")
have another problem regarding with time again. After getting a user input time in "H:mm", in what way can I add like an additional 15 minutes to it? Something like this:
1 - User inputs the time in textbox 2 - Adding 15 mins(which is in an array) to the time
I have a List(Of SomeClass) containing a number of SomeClass items. SomeClass is just a small class with two properties, a Name string and an Int integer:
I have a TabControl on a UserControl. I want the UserControl to behave like a TabControl as usual (it contains only the TabControl and a Contextmenu), including Design-time behavior.I have spent the last two weeks finding out how to add the Design-time behavior and I think I have come a far way.The problem is with adding TabPages during Design-time (while the UserControl is a custom tabcontrol, it is using regular windows forms TabPages).In the Designer class, I have the following code to add a TabPage:
vb.net Dim dh As IDesignerHost = DirectCast(GetService(GetType(IDesignerHost)), IDesignerHost) If dh IsNot Nothing Then Dim i As Integer = tc.SelectedIndex Dim name As String = GetNewTabName() Dim tab As TabPage = TryCast(dh.CreateComponent(GetType(TabPage), name), TabPage) tab.Text = name tc.Controls.Add(tab)
[code]....
So it would add the control to the TabPages collection if it was a TabPage, and use the regular routine otherwise.
(I'm now using 'tc.Controls.Add(tab)' again instead of 'tc.tabCtrl.TabPages.Add')
But, I don't think the designer even gets that far because it is telling me I cannot add TabPages to my usercontrol, because only TabControls can accept TabPages... How can I make my usercontrol understand that it is a TabControl (without Inheriting from a TabControl?)
I have this code in one button: For Each x In ListBox1.Items Label1.Text = "Status: Loading IMDB page..." Dim str As String = x Dim MOVIESNAME = str.Substring(str.IndexOf(""c) + 8) [Code] .....
Is there an option to set a time interval between each check? Because it will load the page (it's not google, it's my personal website with some information needed) and it need to be fully loaded till it gets the information then it would do another check for another listbox1 item. Like.. maybe 5 to 10 seconds is enough.. Webbrowser1 Dim strCDRack() As String Dim cdList As String 'Dim i As Integer cdList = WebBrowser1.DocumentText.ToString [Code] .....
I am trying to extend the functionality of the ToolStripPanel control (which is a panel hosting ToolStrips that can be moved during design-time, as I'm sure you know).One thing I wanted to add was a 'ToolStrips' property, which would be a collection of ToolStrips the user can edit via the collection editor in the designer. So instead of manually placing ToolStrips on the ToolStripPanel via the toolbox, the user can just use the property to add/remove (or even edit) them. This is of course similar to how you add/remove/edit TabPages in a TabControl.So, I came up with this code, which I have used successfully in the past for other controls:
Public Class cToolStripPanel Inherits ToolStripPanel Private _ToolStrips As New ToolStripCollection(Me)[CODE]....
The cToolStripPanel control inherits the ToolStripPanel control and adds the ToolStrips property, which is of type ToolStripCollection. That class, in turn, inherits the Collection(Of ToolStrip). In the InsertItem method, I add the 'item' ToolStrip to the cToolStripPanel. Of course I also need to override the RemoveItem / ClearItems methods but that's for another time.I am 100% sure that this code should works, at least for other controls. If you replace ToolStrip with Button (for example), I can add buttons via the property during design-time just fine, exactly the way I want it.But it seems that ToolStrips are special. When I try to Add a toolstrip (via the collection editor Add button), a null reference exception occurs. I've been trying to debug this all day and I've finally come up with a possible candidate for the problem... (I've actually used design-time debugging for the first time ever, which was pretty cool, and which showed me that the InsertItem method is not run!)
I think the problem is that the collection editor cannot create a new instance of the ToolStrip class. I can remember when trying to inherit from the ToolStrip, I was forced to add a constructor, because the ToolStrip "has more than one constructor that can be called with no arguments".Perhaps this is causing my problem? Do I (and if yes, how?) have to somehow control the creation of a new instance of the ToolStrip? Or am I completely off track and that is not what is causing the problem? I'm sure that it's a problem with the ToolStrip class, since I can use the exact same method with other controls just fine. It's only when I change the type to ToolStrip that it starts getting angry at me....
been racking my brains on this one for a long time, and I've finally decided to ask the question. I had sevaral fields on a vb.net form which need to come together
I am trying to create what I am sure is a simple program to add hours to convert UTC time. I want to type in a UTC time and have it convert for every state in Australia. [Code] Now that works fine however when the conversion goes past "midnight" it then shows the date and time. I have tried about 50 different things but cannot get it to remove the date when the converted time passes midnight. [Code] The string was not recognized as a valid DateTime. There is an unknown word starting at index 18.
still having problems with adding (decimal time) to any given time and getting the answer in 24 hours (Military time) I have a picture of what I have at the moment
I have an SQL Server database with a table in it that has a column labeled DATE (datatype =date).The table also has a column labeled TIME (datatype Integer) that contains hours and minutes.I would like to be able to display the time in a datetimepicker also.
Would it make sense (remember I�m new to VB) to have the time as part of the date column?Doesn�t the date/datetime data type include time(7/24/1996 12:00:00 AM)?If so what is the best way to add the TIME column to the DATE column.I know I can go back to our other system (IBM iSeries) and combined the columns and transfer the data over again but that is chore (the transferring) and I want to learn how to do these kind of things without falling back on my IBM skills.It seems I should be able to add time to the DATE column of the table. None of the DATE data transferred over to this table had time with it.
I need to add integers in a listbox, using for next. Dim intCount As Integer Dim dblTotal As Double ' here are the lines of code that will perform the calculations ' to create a grand total. For intCount = 1 To lstCosts.Items.Count dblTotal += dblSubTotal += intCount Next intCount lblTotal.Text = dblTotal.ToString("C")
The amount of items in the list box is not seso I used the items.count. I have been getting the wrong result. Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click ' Declarations. Dim intCount As Integer Dim dblTotal As Double ' here are the lines of code that will perform the calculations to create a grand total. [Code] .....
in this : I have a button (ADD), a TextBox & a ListBox. Here's what I want, when I write words in TextBox and when I click on Button ADD, it is saved & added in List1
I want to check if an items exists on my pseudo random listbox before adding a newone if the number already exists i need to know before duplicating it.
every time i select an item from the listbox (just 1 at a time), it'll add that item's price to the total. but for some reason it's not doing it. can someone check out my code and see what's wrong with it? i'm getting the item price as the total (what I want it to do is add onto the total)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim total, grandtotal As Decimal If lbSelect.SelectedIndex = 0 Then total = 10
I have an app that I have made. The application generates 14million combinations of numbers and inserts them into an Access Database. As you can imagine, this takes AGES (whole night) to compute. Is it possible to make the same method call twice so instead of one combination being generated and inserted, two or more are?
how can i add a trial with random serials or single serial and once it get registered expire it after 6-12 months....and also if user change its clock time to some day back it remains expire.....