I am trying to write a quiz in Visual Basic 2010 .NET and I have come across a problem while putting in the textbox the user inputs the answer to. The Textbox obscures the upper half of the first line of text.
Public AnswerTextBox As New TextBox
Public stdFont As New Font("Calibri", 12)
Public Sub New()
AnswerTextBox.Location = New Point(100, 100)
AnswerTextBox.Size = New Size(200, 30)
[Code] .....
How can I re-declare arrays in VB.NET at runtime?Example:When I run my program, I will have 100 arrays then I have my button that says "add", if I click it, a text box will appear and I can type there what ever I want to add in my arrays, also I can delete an existing array, but the problem is for example I want to delete an item, and that item is in array number 6, if I delete it, a new item will replace the array, how will I do it?
How I would declare my label here? I'm still learning all of this and I don't know the correct format. I need this to insert the value I have set for a label in a datalist but it's telling me that "MyLabel" is not declared:
I'm trying to place a Label at runtime like this:Form2.lblMaxLandingWt.Location.X = Form2.Panel1.Width * .65but I get an error "Expression is a value and therefore cannot be the target of an assignment"
I'm trying to change the existing 10 labels color on my form at runtime they are named this way (label1,label2,label3...label10) however i haven't bin able to successfully do it so far. Here is the code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim LabelArray(10) As Label For x As Integer = 0 To 9 Dim strLabelName As String = "Label" + x.ToString [Code] .....
I'm trying to create a bunch of labels during runtime that will be "inside" a picture box, so when I move them, if their new coordinates are outside the box's dimensions they wont display, or if they're right on the edge of the box only half the label will be visible etc.
I thought label.Parent = picturebox would work but it doesn't seem to do anything, and Google keeps telling me to set the label's container to the picturebox - which sounds right, but maybe it's no longer a VB.NET thing since the Container property seems to be Read Only.
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick curtime.Text = TimeValue(Now) 'curtime is label
I've got a simple assignment for my adv vb.net class at college and the only thing I'm stuck on is how to move a label around the form at run time with the mouse. Here's the code I have so far[code]...
I want to change the underline property (to true) when the mouse is over it (either mouse hover. enter, or move - i don't know which is best to use.Then change it back using the form's mouse over/hover/enter property.So how would I change it?
I have a form with some labels. If the labels equal certain text, then I want the font size of the label to change.For example, if the text reads "apple",I want the font size of the label to be 16.If the text reads "banana", I want the font size of the label to be 8.This has to occur during runtime without any clicking of the label.I have an idea of the code I want to write in order for this to work, but I need to know where to put the code for the labels.I cannot put this under Label_Click or Form_Load.Where can I put this code so that it works for the labels during runtime?
I'm developing a Windows Forms Application in Visual Basic .NET with Visual Studio 2008.
I'm trying to compose fonts (Family name, font size, and the styles) at runtime, based on user preferences, and apply them to labels.
For the sake of both a simplier user interface, and compatibility between more than one machine requiring to use the same font, I'll NOT use the InstalledFontCollection, but a set of buttons that will set few selected fonts, that I know to be present in all machines (fonts like Verdana).
So, I have to make a Public Sub on a Module that will create fonts, but I don't know how to code that. There are also four CheckBoxes that set the styles, Bold, Italic, Underline and Strikeout.
How should I code this? The SomeLabel.Font.Bold property is readonly, and there seems to be a problem when converting a string like "Times New Roman" to a FontFamily type. (It just says it could not do it)
Like on
Dim NewFontFamily As FontFamily = "Times New Roman"
Is it possible to edit a labels' font and size etc at runtime? If so how would I do this? apparently it is read-only? Im basically learning about decision structures at the moment and would like to change a label font based on a case statement?
I've added some Labels to a form at runtime using this
vb.net Dim x As Integer = 25 For i As Integer = 1 To word.Length
[Code]....
Now, I would like to add text to one of them, but I'm not sure how. I thought by setting .Name I would simply be able to write something like lbl4.text ="A". But, of course, because the Label has not been created yet, this is not possible.
Also, I'm not even sure if .Name is working the way I think it is. I was hoping that it would name each Label consecutively: lbl1, lbl2, lbl3, lbl4...etc.
Am I naming the Labels properly? And how would I add text to one of these Labels?
Im trying to get an application to count letters and words. I want it to count them at runtime and display it in a label box. My form will run and I can type text in my textbox but my lblOutput doesn't update.[code...]
I am creating a custom Label control (by simply Inheriting the standard Label control and re-painting the background and text) because I need a very specific background and border. In the constructor of the control, I set the AutoSize property to false so I can have a standard default size for the new label.
Public Sub New() /*Set the default size of the control to 75x24*/ Me.Height = 24
[code]....
In my application that uses this control, if I create the new custom label at run time (in code), the AutoSize property stays False, and it works properly.If I try to add the new custom label to my form at design time, it comes in with the AutoSize property set to True, and I have to manually set it to False in the properties window. It's not a huge problem, but I don't understand why the behavior is different.
I have the following code: [code] and it's ment to change the backcolor of a label during runtime, which works.But when I use the same code and use it in a smart device - Windows Mobile 5.0 Pocket PC it don't work and comes up with the following error:'ColorTranslator' is not a member of 'Drawing'.Is there a way I can change the backcolor of the label during runtime when creating a smart device application (windows Mobile application) ? I want to be able to use a custom color rather then one already set in vb.net
I'm a second year A-level student (12th Grade U.S. equivalent) studying Computing, Physics and Maths. I like anime, PC gaming, climbing and mountaineering. That's an insight to who I am. Thought I'd add it here to my first post since I couldn't spot and introductions section.
I have created multiple dropdown list at runtime and populated with data. I also have added an eventhandler to determine the selected value of the drop down list.
The code is as follows : Dim tbl As New Table() tbl.EnableViewState = "true"
I have a Visual Basic 2005 program which runs fine if I execute the built Executable. However if I start the application in VS2005 debugger it gives a weird error
Private Sub uiSCORE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uiSCORE.Click 'Displays Correct or Wrong in Labels If ui1Textbox.Text.ToUpper = "FOOD" Then[code]....
I finally finished all my labels and textbox codes for this button.But now I have to code it so that I will be able to click the button and it will calculate all the wrong and correct answers in the labels and then finally place the percentage score in the uiScorePercentagelabel. What I dont understand is how to calculate all the different labels as one and then show the percentage right in the appropriate label.
I have been using vb6 for a while, I am following a tutorial by MS to develop a basic application and a simple task cannot be completed for whatever reasons! The tutorial asks to drag the label object from the toolbox and drop in the tab control container. Then, go to the label size property and adjust the size to some different dimansion. Basic stuff, right? It won't let me do it! After I enter the new dimensions (which by the way are not large or very small), the label size (both width and height) resets back to its original dimensions! I have the vb.net sp1 installed.
I'm try to hide the label after few second but it is updating page continuously after 10sec, i just want it once time when i click save button label on display me successfully for 10sec and get disappear
Is there an effecient way to give one label the ForeColor, BackColor and Text of another one of 3 possible labels? I need to do this frequently for a dozen labels in a windows form.
I am using a label to display a song for an mp3 player. I wanted to scroll the text inside the label for anything that is longer than the label width. I figured out the width of the label and if the width of the text inside the label is longer. But I have no idea how to turn this into subtracting parts/pixels of the text currently displayed and how to append the subtracted parts to the end of the new text.
Sub f1timer2tick() Dim g As Graphics = f1l2.CreateGraphics Dim s As SizeF If f1l2.Text.Length > 19 Then
is it possible to show a figure in one Label in another label through a button click event? for instance, i have a figure in label1 and i want to display that figure in a label of another form is it possible?
i am developing a web browser in vb.net as my final year project.currently working on displaying browsing history in labels contained in a panel . i have coded label array dynamic in size , using redim stmnt in some method say abc () . now i want to handle event generaten on clicking these label .but i have no idea how to do it .
Public Class frmhistory Dim domainarray(50) As String Dim lblpagename() As Label