Colour Text Depending On Type?
Feb 18, 2010
I am trying to make the application similar to Notepad++. Notepad++ colours text depending on what type they are, eg. HTML, PHP, CSS, Java, ect.
I just wondered if somebody might be able to help with this? I have no clue where to start, but I have an idea of how it would happen.
- Text is entered into the RTB (RichTextBox)
- The text is read by the program as it's entered
- The text is coloured depending on the type
View 5 Replies
ADVERTISEMENT
Aug 24, 2011
I have a little loop what reads in a text file the text layout is[code]...
View 9 Replies
Jul 18, 2012
I try to make my datagridview rows change colour depending on value on a row cell. I ve tryed everything i found on the web but nothing..
View 3 Replies
Feb 25, 2010
Im trying to colour cells in a datagrid depending on the value of the cell. Ive got a situation where I the 1st time the grid id displayed the coluring doesnt work, but then if I refresh the grid the colouring does work.
[Code]...
View 3 Replies
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
Apr 13, 2012
I've just finished creating a basic login system which enables you to create an account and select either a "Student" or "Teacher" account.
Once the account is created it's stored in an Access 2007 database. The field the account type gets stored in is called AccountType. When users log in with their unique username and password I want the program to take them to a different form depending on whether they have a student or teacher account.
View 2 Replies
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
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
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
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
Apr 8, 2010
My VB2010 programme changes the background colour of a button (butExtra.BackColor = Color.Red). But how do I restore the colour to the default "Control" colour?
View 2 Replies
May 30, 2011
i am looking to change the windows colour and colour intensity. These settings are accessable through Control PanelAppearance and PersonalizationPersonalizationWindow Color and Appearance But is there a way that i can remotely change these two settings through functions in my windows form application? Also is there any way of removing the slight blur on the window bars/taskbar when using an aero theme?
View 1 Replies
Mar 28, 2011
I am currently working on a piece of code that allows the user to change the colour of some text in a text box. I have done the size and fonts fine but colour i am struggling on. I am using radio boxes to select the option. The code I used so far that works is this but how do I add the colour into it?
Private Sub radioArial_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radioArial.CheckedChanged
If radioArial.Checked = True Then[code]....
View 6 Replies
Sep 16, 2009
I'd like to replace all the white pixels in a bitmap image with pixels of the colour "Color.FromKnownColor(KnownColor.MenuHighlight)". Is there some method in the Image, Bitmap or Graphics classes I can use, or will I simply have to inspect each pixel in the image with GetPixel, check whether it is a white pixel, and then set it with SetPixel?Here is the code I am using now:
Private Shared Sub highlight(ByVal b As Bitmap)
Dim highlightColour As Color = Color.FromKnownColor(KnownColor.MenuHighlight)
Dim whiteARGB As Long = Color.White.ToArgb
[code]......
View 8 Replies
Sep 13, 2010
Is it possible to add text next to its value in a cell, depending on its value?
as example if the value of the cell is less than 1.00, the box will turn to red color and will be appear.
attachment 1 (pic1) is the image before and attachment 2 (pic2) is the image result i want.
i have successfully color the box and having problem with adding the text.
View 2 Replies
Mar 12, 2010
I am trying to make syntax highlighting text-box. I have got it done pretty much, but I am having a problem. Whenever I type a word like below:
<html>
It appears fine,But if I type it in like below:
<img src="
Because there is no space inbetween the = and the " it doesn't show up coloured.Here is the code I use:
Public Class SyntaxRTB
Inherits System.Windows.Forms.RichTextBox
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" [code].......
View 4 Replies
Apr 26, 2011
Well, i created a form and added a textbox and a button to it, when i press that button this text "VB Forums" appears in the textbox. The question is, how can i make that those initial letters (VB) appear in another colour e.g Red but the remained Text (Forums) stay as it is.
View 6 Replies
Aug 20, 2009
This is the code I have, but it doesn't work, does anyone know how to change the colour like I'm trying to do.
'If the text is changed
Private Sub htmledit_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles htmledit.TextChanged
[code].....
View 8 Replies
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
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
Apr 7, 2012
I am making a Hangman Game.
1. How do I change the colour of the text I am entering. i.e. if the letter entered by the user IS in the word, then I want to make that text appear green in the other textbox, "guessed letters"
2. I also want to know how to mask and unmask certain characters at will. i.e. when the user guesses a letter, the program checks to see if the character is in the predefined word. If it is, then I want it to unmask that letter on the label, "Word Label". I also want the program to start with the word already masked.
3. How do I take a random word from a text file for the user to guess?. I have a text file with all the words of the dictionary on a new line.
Here's the mediafire link to my project: [URL]. (The dictionary text file is included)
View 2 Replies
Oct 1, 2009
I am trying to draw some multi colour text onto a form using the paint event and the GDI+ object (note it has to be done using the GDI as i will be needing to scale and do bmp pixel manipulation on the resulting graphic . I have so far managed to create a class and collection winch allow the user to move the text around and change the displayed string, font and colour.
My question is how can i change my class so that it draws multi colour text? and if possible allow the user (uinsg the mouse to graphically select parts of the text.
Below is a work link to the project so far:-
[URL]
View 4 Replies
Jul 27, 2010
I have been experimenting with my windows form application(vb 2008/10) and made sure that the top part(glass part) extended to become a bit larger.Now 1 problem occurs. Everything, like text, which is black, will become transparent so unreadable. With labels and pictures, I solved the problem, I just write a string(e.graphics.drawstring) and for labels / titles I use a long method(not important). But now the problem comes
View 6 Replies
Jul 12, 2011
I would like to know what code snippet I would use to keep the RTB text colour the same as the chosen foreground colour,Currently any text colour that I ,say for instance C&P into the box is black (apart from when I manually type in the RTB).
View 2 Replies
Jul 20, 2010
Ok so i have a form of witch the user is able to change the background image of. The form has labels on it. How can i make the fore colour change to be if possible the opposite colour to the image where the label is in order to make it readable?
View 3 Replies
May 28, 2010
I have 2 text boxes one for email and one for Name. If text is entered in email I want to make Name required field. How can I do this using .net validation controls?
View 1 Replies
Feb 12, 2011
I am overlaying a staff members ID number over their photo using drawstring.
As the image can vary from dark to light no one text colour can assure that the text will be readable.
Is there an easy way to invert the text colour pixel by pixel based on the colour of the image pixel the text will be drawn onto.
View 1 Replies
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
Oct 1, 2010
i have a class where are code the methode that i have to use in my form. i want to display on a button with a if statement a text value depending of the requirement are met. i put the code of the class here:
[Code]...
View 12 Replies
Nov 9, 2011
I am trying to conditionally change the colour of some text in a textbox, for example: If n=> 10 then txtbox1.forecolor = red
This doesn't appear to work, does the textbox need to be a 'rich textbox'
View 3 Replies