Changing Colour And Size Of Certain String In Text Block?

Mar 9, 2012

I have a button (btnAdd) that adds the content of a textbox (txtName) to a textblock (lblName). I want to add a date to the textblock when btnAdd is pressed but I want it to be a different font size and colour. So far my code looks like
lblName.Text = txtName.Text " " + DateTime.Now

I only want DateTime.Now to be a different size and colour. Is this possible? Instead of a label I need to display it in a listBox. My new code:
listBox1.Items.Add(txtName.Text " " + DateTime.Now)

View 1 Replies


ADVERTISEMENT

Changing Text Colour In Richtextbox?

Jun 21, 2010

RichTextBox1.SelectionStart = RichTextBox1.Find("Not Found")
RichTextBox1.SelectionColor = Color.Red

that is my code.. my problem is in my richtextbox1, there are many line that contain "Not Found". So how can i change colour for all of that text to red colour? my code only work only with a single line that contain "Not Found".

View 2 Replies

Changing The Colour Of Selected Text?

Dec 4, 2010

i am creating an rtf editor and i am trying to Change the colour of selected text. at the moment my code changes the colour of the whole text, but i want to be able to highlight my text and have 2 seperate colours, below is my code. Have tried to add .selectedText in but it says it 'SelectedText' is not a member of 'System.Windows.Forms.ColorDialog'.

ColorDialog1.Color = Editor.ForeColor
If ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Editor.ForeColor = ColorDialog1.Color
End If

View 4 Replies

Changing Text Size In Browser?

Jul 23, 2009

Ok, I have this command, which I think should change the text size in the webbrowser:

CType(AxTabControl2.SelectedTab.AttachedControl.Controls.Item(0), browse).document.ExecCommand("EditMode", False, System.DBNull.Value)
CType(AxTabControl2.SelectedTab.AttachedControl.Controls.Item(0),

[code]......

View 1 Replies

Change The Colour (background Colour Or Text Colour) Of Just A Certain Item Or Item(s)?

May 7, 2010

Is there any way to change the colour (background colour or text colour) of just a certain item or item(s)?

View 2 Replies

Changing Colour Of Alphabets?

May 7, 2010

if i have ten textbox. in each with different a b c d e f g h i.. i want to retype it and the colour wil change. lets say i backspace a and when i retype it will change to green.

View 2 Replies

Changing Of Colour In Textbox?

May 7, 2010

my puzzle have random characters. and i want the colour of the character to change when i retype it. Lets say R... i backspace and retype r but there's coulour. can i know how?

View 13 Replies

Forms :: RichTextBox - Changing Font Size Without Changing Families And Styles

Sep 21, 2010

I'm searching for a way to change the font size of selected text in a RichTextBox (rtf) having different font families (e.g. Arial and MS SansSerif) and font styles (underline, bold...) using the FontDialog, but without changing the families and styles. The following code resets all the font attributes, which is not what I want:

[Code]...

View 5 Replies

VS 2010 Changing Button Colour?

May 28, 2012

I know this is a really noob question but in my program when my button is enabled true/false I change the colour so i was thinking if there is an easier way to do this? or is the following the best way?

[Code]....

View 2 Replies

Changing Font Size & Bold - Get Property 'Size' Is Read Only?

Feb 27, 2009

I'm new to VB in Visual Studio 2008 and am just trying out some simple test.I just want to change the Font & Boldness of some text but get the following errorProperty 'Size' is Read onlyI have been browsing the forums and it seems that changing the font size etc isn't as simple as

TextBox.Font.Size = 12
TextBox.Font.Bold = True

Is this true, and if so what do I need to do

View 5 Replies

Changing Label Colour - Rotating And Grouping

Jan 24, 2011

First I am using 'Microsoft Visual Studio 2010' and am making a 'windoms forms application'. I am wishing to implement a way of changing the text colour through out the whole application. I have managed to put on a customisable background using

Quote:

CODE:

I know I'll have to change the 'BackColor' bit but I don't know what to. Is there something that turns all text on the form one colour or do I have to do it label by label?

Also I am can't figure out how to rotate labels to display text at a 60 degree angle (to display along the edge of an equilateral triangle) And for the triangle I have drawn it using lines which move independently from each other, is there anyway to 'group' these lines together so they are fixed.

View 3 Replies

VS 2008 Changing Colour To Listview Selection?

Nov 28, 2009

Is there any way to change the default colour to the highlight when a listview row is selected? Apparently the default blue colour causes some problems for some users who have some visual eyesight problems. They didn't tell me what colour they wanted but they did indicated the blue is annoying.

View 2 Replies

VS 2010 : Changing An Oval Shape Colour?

Nov 1, 2009

im trying to make an ovalshape change colour when i click a button?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "hello" Then
OvalShape1.FillColor = Color.Red

[code]....

View 1 Replies

Changing Font Colour On Alternate Rows In GridView

Aug 16, 2011

I'm looking for a way to change the font colour on alternate rows within a datagrid. e.g. normal row would be green and the alternate row would be blue. I can change either by using
me.datagrid.Styles.Row.Forcolour
me.datagrid.Styles.AlternatingRow.Forcolour

The problem is that I am having trouble using both of them together as I need to manipulate both colours. I have created a HtmlRowPrepared event and have been setting them there, however, If I set the Row.Forcolour first, it will over ride the AlternatingRow.Forcolour and vice versa. This needs to be done via SEVER SIDE code only as the colour choices are held in the database.

View 2 Replies

Visual Studio 2008 - Changing Colour Of Types For .net In VS?

Apr 29, 2009

I am currently working on a VB.NET project and the hardest thing that I am having trouble with is that everything is black and blue. Having worked a lot with C#, I really like the way that types are colored differently.

I have tried going in and having a look at the "Tools > Options > Fonts and Colors" and the various "User Types" under "Display Items" is set to a different colour but its not reflecting that colour in the text editor.

View 3 Replies

VS 2010 - Changing Colour Of Certain Cell In ListView Column2

Jul 6, 2011

I am making a diary Form in VB.NET to do this I am using a listview with two columns.
Column 1 consists of a list of time and column 2 is the description
Can I change the colour of certain cells in column 2 only. So when I read in the data from the database it reads in the description and then puts the data in the relevant time slot but I want the recent cells of the description column to be a different colour.

View 5 Replies

Control Size Changing According To Forms Size?

May 11, 2009

I am after a property that makes a control (textbox, datagrid or other) move according to the forms size. Because some of the controls I got does that, and I really don't want it. I've been looking at them but could not find it

View 4 Replies

Html - Regular Expression From Font To Span (size And Colour) And Back (.NET)?

Mar 26, 2010

I am looking for a regular expression that can convert my font tags (only with size and colour attributes) into span tags with the relevant inline css. This will be done in VB.NET if that helps at all.I also need a regular expression to go the other way as well.To elaborate below is an example of the conversion I am looking for:

<font size="10">some text</font>

To then become:

<span style="font-size:10px;">some text</span>

So converting the tag and putting a "px" at the end of whatever the font size is (I don't need to change/convert the font size, just stick px at the end).The regular expression needs to cope with a font tag that only has a size attribute, only a color attribute, or both:

<font size="10">some text</font>
<font color="#000000">some text</font>

[code]....

I also need another regular expression to do the opposite conversion. So for example:

<span style="font-size:10px;">some text</span>

Will become:

<font size="10">some text</font>

As before converting the tag but this time removing the "px", I don't need to worry about changing the font size.Again this will also need to cope with the size styling, font styling, and a combination of both:

<span style="font-size:10px;">some text</span>
<span style="color:#000000;">some text</span>

[code]....

I am extracting basic HTML & text from CDATA tags in an XML file and then displaying them on a web-page.The text also appears in a rich-text editor so it can be edited/translated, and then saved back into a new XML file. The XML is then going to be read by a flash file, hence the need to use old-fashioned HTML.

The reason I want to convert this code is mainly for display purposes. In order to show the text sizes correctly and for it to work with my rich text editor they need to be converted to XHTML/inline CSS. The rich text editor will also generate XHTML/inline CSS that I need to convert 'back' to standard HTML before it is saved in the XML file.I know the temptation will be to tell me a number of different ways to set up my code to do what I want but there are so many other permutations I haven't even mentioned which have forced me down this route, so literally all I want to do is convert a string containing standard HTML to XHTML/inline CSS, and then the same but the other way round.

View 6 Replies

Save A Labels Text That Keeps Changing Due To A String?

Apr 22, 2011

I am creating a dice game that you try and obtain a straight with.This is my equation for the random roll.

Private Function CreateRnd() As Integer
Randomize()
CreateRnd = CInt(Int(Rnd(1) * 6) + 1)
End Function

This is what I am trying to do

Private Sub RollBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RollBtn.Click
'checkboxes
Dice1.Enabled = True
Dice2.Enabled = True

[code]....

View 8 Replies

VS 2005 Saving Image Changing Image Size And Canvas Size?

Dec 11, 2010

I use some code to successfully resize and save images - but I want to save the image to 800x800 px size on a canvas of 900x900px so it has a white border type thing around it.

View 8 Replies

Can Auto-size Font Size Follow By Length Of String

Jul 4, 2010

I had set a print format to print some word in a Text box, when I input the text in text box is an normal size from system,but I want it print out to printer follow the Rectangle size that is was set to print out on paper.actuary i want it can auto size the font size follow by the length of string.

View 1 Replies

Changing Size Of A Groupbox?

Sep 26, 2009

okay well I want to be able to change the size of my Groupbox when I check my check box. I have tried this code and it did not work

If Checkbox7.checked = true then Groupbox1.size = (309, 446)

I don't get why this wont work, I tried others to but I cant get it to work.

View 1 Replies

Changing Size Of Imagelist?

Dec 27, 2009

How do i change the size of Imagelist images at runtime?

ImageList1.ImageSize = New Size(18, 18)

But it isnt working..

View 8 Replies

Changing The Size Of Richtextbox?

Apr 9, 2012

I have a rich textbox and when you click on it i want the size to increase from 329, 20 too 329, 285. How would i accomplish this.My current code is:

richtextbox1.size = "329, 285"

but i can an error and im not sure what i should do.

View 3 Replies

Colour Picker Scanning - Log On Method - Users Selecting A Colour From A Paint Panel

Mar 15, 2012

To .NET after getting tired of using VB6 due to the lack of functionality. I'm trying to create a log on method for a system which will involve users selecting a colour from a paint panel and then placing/drawing the colour in 1 or more tiles of a grid, basically a 3x3 grid in which for example they selected the blue colour and drew in the top left tile and the bottom left tile. The logon is selecting the correct colour and placing the colour in the appropriate tile. What i want them to be able to do is place even a single pixel of colour so it has a high accuracy. So far i have a timer which loops from the width of the grid to the height of the grid.

Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
Dim BMP As New Drawing.Bitmap(1, 1)
Dim GFX As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(BMP)
GFX.CopyFromScreen(New Drawing.Point(MousePosition.X, MousePosition.Y), _

[CODE]...

To start with i have just hard coded the colour i want it to detect. At present it produces an error. Parameter must be positive and < Width the error is on System.Drawing.Point(i,j). If i place the mouse over the colour then run the program it will say it has been found, but otherwise it wont find the colour. I believe i am not updating the location of the pixel or something to that effect.

View 10 Replies

Get The Combobox To Display The Stored Colour As The Default Colour When The Form Loads?

Nov 30, 2011

I've got a combobox which loads the system colour list, the selected colour is stored in the registry (i've tried storing the index number value aswell as the colour name - how can i get the combobox to display the stored colour as the default colour when the form loads? It always defaults to the first item in the colour list I've tried

[Code]....

View 3 Replies

Video Pixel Colour - Check Whether The Colour Chas Changed Significantly?

Apr 8, 2009

So I have got a program with a timer on, a few labels displaying coordinates, and two buttons. Here is my

[code]...

It displays the color of the pixel at the coordinate typed into the text boxes.I have a video of a tennis ball which is bouncing on the spot, and the background in brown, so when the tennis ball comes into view there is a significant color change and i want it to start and stop a timer each time the colour changes significantly.So my question is, how do i get it to check whether the colour chas changed significantly?

View 2 Replies

Make The Colour Of The Text Between These Two Text Values Green?

Feb 9, 2010

Ok, i've been making my own syntax highlighter for my project, and i need to know how to make the colour of the text between these two text values green

[Code]...

View 14 Replies

VbCrLf Keeps Replacing Text In A Text Box When It's Meant To Be Displaying The Next Block Of Text Below It?

Mar 14, 2011

I'm building a program in which it asks for your name and age and determines a ticket price based upon these details. I want it to show the person's name, then their age, (jump down a line) then their ticket price, and then it jumps down a line to show the next person's name, age and ticket price. Issue is, when it's meant to jump down to show the next person, it just completely deletes the last person's details.I'm using this line of code:

TxtFareShow.Text = (Name & Age & vbCrLf & Price) & vbCrLf

How do I fix this?

View 1 Replies

Changing Size Of Form Using Up / Down Button?

Jun 9, 2009

I have a problem with my program. I have a form with 2 buttons UP and DOWN. I use this buttons to change the size of the form. The first step works fine. If I press the down button I get MsgBox ("Go Down", vbYesNo,) if I press Yes the form resize from 300 to 600 and if I press no it stay 300. The problem is, if the form is already at 600 everytime I press the down button I get the MsgBox ("Go Down", vbYesNo,) if I press Yes it recycles it self the form goes to 300 and then back to 600 and if I press No it stays 600. What I want is if the form is already 600 and I press the down button it skips the MsgBox ("Go Down", vbYesNo,) and the form stay at 600.

Public Class Form1
Private Sub ButtonUp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonUp.Click
Dim answer As String
If Val(TextBox1.Text) < 0 Then
answer = MsgBox("Go Up", vbYesNo, )
If answer = vbYes Then
For x = 300 To 600
[Code] .....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved