I want to have an input from the user to define the font of a rich text box... the only problem is the only way I know how is to use a string... When I use a string it give the error of:
"An unhandled exception of type 'System.InvalidCastException' occurred in PWT Notepadd.exe
Additional information: Unable to cast object of type 'System.String' to type 'System.Drawing.Font'."
TextBox1.font.size = "8".Gives me an error.... what would be the proper syntax to define a font size in code.yes I know it can be changed in the properties but I need to know to change it in code too..
I parse time from string. The time in string is always GMT (you may say it equals UTC).Now I need to convert this time to local time, but there is a catch!For some reason the time parsed from string is being assumed as local time. I need to tell the bloody machine that this time is UTC/GMT, but not local.
Some examples:My string looks like that:
06 Apr 2012 16:27:00 GMT
I parse it like that (eventtime is my string - like above):
vb Dim eventtimeobject As DateTime = DateTime.Parse(eventtime) Dim eventtimefriendly As String eventtimefriendly = String.Format("{0:dd MMM yyyy HH:mm}" + " GMT", eventtimeobject)
and now if I would like to convert it to local time nothing will happen as it is assumed that the above time is actually local.obviously if I tell it to convert the above time to UTC/GMT it will change it, as it does not know what this time is in GMT already.How do I do it? How to I tell the computer that it is dealing with GMT already?
I'm programming in VB.NET using Visual Studio 2008. I need to define a string literal containing the character "÷" equivalent to Chr(247). I understand that internally VS uses UTF-16 encoding, but when the source file is written to disk it contains the single byte value F7 for this character.
This source file is processed by another program that uses UTF-8 encoding by default, so it fails to interpret this character correctly, attempting to combine it with the following single-byte character. What encoding would correctly interpret the single byte F7 as the single character ÷?
Alternatively, is there a way of expressing a non-ASCII literal that uses only ASCII characters - like using some kind of escape sequence?
I would like to develop a Windows Service in VB.NET to monitor different SQL databases running in different servers. The user will enter/define connection string for each database.Also he/she will define connection interval.
For example, database A needs to be checked in every 5 mins and database B needs to be checked every 24 hours.
I have created a User Control (UC) where user type the information it needed and save it ti MS SQL Database and also have created a User Control dedicated for it's button, since my main form has split container and has two panels, one for UC which contain the button only and the other one for my Main UC where user enter the information.I created a Module that contain the function on adding the data type in UC Main to the database.
[Code]...
on My UCButton named "Save" I just call the function AddUserInformation. But the problem is the variable where it bind to the ucUserControlMain textbox remains Blank, When i query the my database table, only the UserInforID and the DateAdded has been updated and the other column remains blank where the variable get it in the UCMain Textbox...
I need to use a richtextbox, not a normal textbox because of the way it keeps the caret position, from line to line. But I need to keep the text at the same font all the time even if it is pasted. At the moment I have it selecting the entire text and changing the font to the original (Lucida Console) but it look horrible when you paste into it as it flashes blue.
Anybody have any idea about how to change the font of the string. Suppose Dim strFind as string="Answer" I want to change the font of the string as "Verdana" Purpose behind that, I have an richtextbox1 contains the questions and richtextbox2 contain the answer so while concating i want to append text "Answer" before answer. but these concatenate string then displayed in richtextbox3. But the appended text showing in diff. font while question in different font (question has "Bookman Old style7" font)
i can't convert string to font.[code]when i set font in textbox success but i want to display in richtextbox. error list : value of type 'system.drawing.font' cannot be converted to string.
I am allowing the users to be able to make their own font choices for a listview. What would you consider the best approach for this. Should I save it to the DataBase or to a file in the application folder, and what properties should be saved to make sure that the font is redisplayed properly when the application is restarted?
This Is my code Dim myresult As New DialogResult With Me.FontDialog1 myresult = .ShowDialog() If myresult = Windows.Forms.DialogResult.OK Then Dim Conv As New System.ComponentModel.TypeConverter() [Code] ..... but Nothing happend To the TextBox "txtH1"
why the buttons in an application I developed, shifts from its original position whenever the font size of the Windows is changed to Extra Large (Properties > Appearance > (Font Size=Extra Large).
I can't stand this font smoothing on VS2010. Is there any way to turn it off?f you don't know what I'm talking about, compare the VS2010 screenshot to VS2008
How can I change font color of a string. I set the fore color properties of the label holding the string but seems that only works when the string is displayed in that label. Is there a way of setting the color of a string itself such that it displays any where with that color by default. I am actually sending this string as email but wanted to format it in a way that it will display differently however it doesn't.
Via the FontDialog I have retrieved a font. After saving the font (in an XML document) and retrieving it again, I have a string in the following "format";
I'm saving the font of a label to a text file, and when I open the text file with my program, I want the label to have the same font that is listed within the text file. Now, the only problem I am having is that when I try to write the code for opening the text file, I can't set the font property of the label to a string. Label1.Font=[Font: Name=Microsoft Sans Serif, Size=9.75, Units=3, GdiCharSet=0, GdiVerticalFont= False]Here is what the code to open the text file and set the font of the label looks like:[code]The problem for the code happens at line 6. The error is: "Value of type 'String' cannot be converted to 'System.Drawing.Font'"ing each part of the font in the text file(i.e. Writing Font.Name and Font.Size properties in separate lines and then setting the label's font properties to each line accordingly), but I still get hit with the same error.
I am trying to make a calculator program. I would like the display(text box) to have a white background, with black font. So I set the "enabled" property of the textbox to "false"(because I want it to display, not receive input) and then choose the background colour to be white. In the form designer, the text colour is black, which is what I want.But when I start debugging, the text becomes the colour of the form. How can I make the font black?
Is there any way to make my application to use a predefine font type and size so if in Windows the fonts are set to be large it will not effect my application fonts in the controls?
change the character spacing of a string or textbox output? One possibility is by creating a custom font, but i am unsure if there is a property in one of the overloads that will allow me to change character spacing?!
I can't change change the font size or font name or color of the text in the DHTML Editing Control. I have 2 listbox controls FontNameList containing all of the installed fonts on my PC and FontSizeList containing some numbers to be used as fontsize and I use the execommand and build my App but the font did not change instead it grew bigger but when I tryed to change it back it stayed the same. The Code for that was:
printing barcode 39 truetype from idautomation i already try their integration guide but it didnt work....i want my project to
1. Label1 changes to what i type in the textbox1(the label1 is a barcode i change the font of the label1 into IDAutomationHC39M font from IDAutomation)...ive already done that...
2. print the barcode(which is the label1) when i click my button named btnprint..but it doesnt print...
I am creating an excel report from vb.net. Now it works. But i realize that the apparent does not make sense. I just want enlarge some font size and change font name plus setting up the page to fit my receipt printer (Epson TM-T88IV).