|
madhu Rao wrote: Auto refresh
u can use the timer control for that.
Apurv
A man is but the product of his thoughts. What he thinks, he becomes.
.......Mahatma Gandhi
Be the change you want to see in the world.
.......Mahatma Gandhi
|
|
|
|
|
Simplest way to do it is
or (the version depends on what standard your page is employing)
|
|
|
|
|
Why dont you ask in the ASP.Net forum, you should get more answers.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Formatting inside Rich Text Box
Is there a way I can make certain sections of text formatted in a rich text box? Like parts of it are bold, underlined, different sizes or colors, all in the same Rich Text Box.
I'm making a program that will use an HTML view and a Standard view, and I have no way to format the standard view. So, in the HTML view, it would show "This is bold. This is Italic.", but in the standard view it would show "This is bold. This is Italic."
Help me??
|
|
|
|
|
Hi,
that is a basic but endless question. Formatting is what makes the RichTextBox different from a regular TextBox. Hence the answer is contained in the documentation on RichTectBox (read all of it), and in the many articles (CodeProject and other) on the subject. Google is your friend.
modified on Saturday, November 8, 2008 9:15 AM
|
|
|
|
|
You can make custom formatting by using RichTextBox.Select(int index, int lengthofselection) and after applying formatting to selection like RichTextBox.SelectionFont = "......", then calling RichTextBox.DeselectAll() and repeating the cycle. This still is kindda lame ... i would suggest looking at rtf's file format and make the formatting yourself or search for a class that does that.
|
|
|
|
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Microsoft.VisualBasic;
using System.Collections;
namespace Notepad1
{
public partial class formNotepad : Form
{
private string name;
public formNotepad()
{
InitializeComponent();
}
private void btnClear_Click(object sender, EventArgs e)
{
textBox1.Clear();
}
private void btncancel_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void sAVEToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
}
private void sAVEASToolStripMenuItem1_Click(object sender, EventArgs e)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
}
private void dELETEToolStripMenuItem1_Click(object sender, EventArgs e)
{
textBox1.Clear();
}
private void SELECTALLToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.SelectAll();
}
private void cLOSEToolStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
}
private void uNDOToolStripMenuItem_Click(object sender, EventArgs e)
{
textBox1.Undo();
}
public void rEDOToolStripMenuItem_Click(object sender, EventArgs e)
{
// The redo code
}
private void NewtoolStripButton1_Click(object sender, EventArgs e)
{
if (!textBox1.Text.Equals(string.Empty))
{
if (MessageBox.Show("Do u want save the text Data", "Notepad", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
}
else
textBox1.ResetText();
}
}
private void opentoolStripButton2_Click(object sender, EventArgs e) //image
{
if (!textBox1.Text.Equals(string.Empty))
{
if (MessageBox.Show("Do u want save the text Data", "Notepad", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
else
textBox1.Clear();
}
else
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
name = openFileDialog1.FileName;
textBox1.Clear();
textBox1.Text = File.ReadAllText(name);
}
}
private void savetoolStripButton3_Click(object sender, EventArgs e) //image
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
}
private void deletetoolStripButton4_Click(object sender, EventArgs e) //image
{
textBox1.Clear();
}
private void webtoolStripButton5_Click(object sender, EventArgs e) //image
{
Interaction.Shell("C:\\Program Files\\Opera\\Opera.exe", AppWinStyle.NormalFocus, true, -1);
}
private void toolStripButton1_Click(object sender, EventArgs e) //image
{
textBox1.Copy();
}
private void toolStripButton2_Click(object sender, EventArgs e) //image
{
textBox1.Paste();
}
private void toolStripButton3_Click(object sender, EventArgs e) //image
{
textBox1.Cut();
}
private void fontStyleToolStripMenuItem_Click(object sender, EventArgs e)
{
if (fontDialog1.ShowDialog() == DialogResult.OK)
textBox1.Font = fontDialog1.Font;
}
private void colorToolStripMenuItem_Click(object sender, EventArgs e)
{
if (colorDialog1.ShowDialog() == DialogResult.OK)
textBox1.ForeColor = colorDialog1.Color;
}
private void formNotepad_Load(object sender, EventArgs e)
{
}
private void formNotepad_Resize(object sender, EventArgs e)
{
int frmwid = formNotepad.ActiveForm.Width;
int frmht = formNotepad.ActiveForm.Height;
textBox1.Width = frmwid-10;
textBox1.Height = frmht-90;
}
private void formNotepad_FormClosing(object sender, FormClosingEventArgs e)
{
if (!textBox1.Text.Equals(string.Empty))
{
if (MessageBox.Show("Do u want save the text Data", "Notepad", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
name = saveFileDialog1.FileName;
File.WriteAllText(name, textBox1.Text);
textBox1.Clear();
}
else
Application.Exit();
}
}
else
{
Application.Exit();
}
}
private void WordWrapToolStripMenuItem_Click(object sender, EventArgs e)
{
if (WordWrapToolStripMenuItem.Checked)
textBox1.WordWrap = true;
else
textBox1.WordWrap = false;
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
String str;
str = textBox1.Text;
if (e.KeyChar == 13)
if ((str.CompareTo(textBox1.Text)) == 0)
}
private void textBox2_MouseClick(object sender, MouseEventArgs e)
{
textBox2.Clear();
}
private void mENUToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void Find_TextChanged(object sender, EventArgs e)
{
// FIND code
}
}
}
Thanks friends
madhu
|
|
|
|
|
You forgot to ask a question...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
No, we're not going to write your code for you. In order to research this, go to Google and start researching "command pattern".
|
|
|
|
|
Sorry, but we're not doing people's homework in here.
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
I am not sure, if it is a C#,.NET or ASP.NET question.
but i need this in my asp.net site, i have to convert a string passed as a query string to be converted to GUID.
Please tell me how to do this.
Thanks
Apurv
A man is but the product of his thoughts. What he thinks, he becomes.
.......Mahatma Gandhi
Be the change you want to see in the world.
.......Mahatma Gandhi
|
|
|
|
|
The GUID structure has a constructor that takes a string. Have you tried using that?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
And why it's not a .Parse method I have no idea.
|
|
|
|
|
hai all,
we developed windows application and we tried to deploy this application in client machine using installer class(VS 2005 with custom actions), we have to find the installed path of the application in client machine while installing using c#
Thanks & regards,
vishnu.
|
|
|
|
|
|
|
Hi....
I am new to excel programming.I have a small problem creating histogram in excel using C#.I have to carete histograms for a discrete data.Can somebody help me out undertsanding this and letting me know what actually a histogram with discrete data looks like.Please do help me out.
Thnk You.
|
|
|
|
|
In order to do it from C# in Excel, you have to understand how to do it in Excel first. Start reading these[^].
|
|
|
|
|
I have created some module in C#.net Visual studio 2005. Now I want to incorporate them under a single project.I need to assign the permission of each module's Controlls based on User previllage. So to assign the permission I think, I need to know all modul's forms and control. It may get from each modul's design.cs file easily. but I want to access them from a MDI form where all module are chiled of that MDI and want to assign permission based on user previllage.Now question is that how can get the all modul's forms and control's properties from that MDI form.
|
|
|
|
|
Dear SayemAhmed!
It is not possible to get all the properties name except from the .cs file.
Thanx.
NNur
|
|
|
|
|
Reposting the same question won't change the answer. What you want to do is not practical and a nightmare to support. Each module/form/whatever in your app should be checking the user object you have and responding accpordingly itself. Try to go through the entire project and "set this, setup that, change this" is extrodinarily inefficient and the code must be updated coninuously as the application changes.
|
|
|
|
|
Hi,
which are the best pratices of using xml as database? can i query it like in sql server? wher linq fits here?
links appreciated thanks
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Using XML as a database is generally a bad idea because it's a lot slower than using an actual database. LINQ helps a little, but I certainly wouldn't want to write a crapload of code to do it. Not only do you have to load/save the data continuously, you have to worry about rolling back transactions, and other stuff that the database server usually takes care of.
Generally, if the data in your XML file exceeds 1mb, and has more than just a few "tables", it's a better idea to use a real database.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
how can i save the contents of a dgv to a xml file?
i know how to read from xml to dgv. because the dataset has more that one table and the datagrid only display one table, im affraid o mess it when saving.
I Checking it know, but if anyone can direct me to some link or code would be helpfull
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Move your data to a DataSet/DataTable object(s) and the rest is easy. It's save to an XML file in one statement.
|
|
|
|
|