|
Hello freind,
I have taken a rich textbox in a form and i want to show all the content of RTF file. and also if any where in the file any word is bold then i want to add tag bold of any bold words just like HELLO
so please suggest me how i will add tag starting of bold word and in end .
Thanks in advance..
|
|
|
|
|
You would have to first load the RTF file into the richtextbox. Then you will have to write code that will loop through all of the text searching for the words to bold. You are going to set the selection start and end points and then bold them.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Hello All,
I'm developing an application. In this application i want to detect the printer status. status means online , offline , low paper, no paper , paperjam. Can any one give suggestion on this.It will be great helpful for me.
Thanks in advance.
Sekhar Reddy
|
|
|
|
|
|
I am at a loss. Can someone PLEASE help me with the above error message?
I have a Windows Application with a PresentationLayer, DataAccessLayer, BusinessLogicLayer and Web Service for Client Application Services.
When I run my app it executes as follows:
I login using the loginform. Upon login a new form is opened and the form_load event executes. When this happens the following line executes -
var _bllEntities = new BLLEntities(); . It then jumps to my BLLEntities.cs file where the following line executes -
readonly Entities DALEntities = new Entities(); . It is at this line where VS tells me that the Type initializer for DAL.Method threw an exception.
The innerexception tells me that I need to use the "new" keyword that I have as you can see, and the second innerexception tells me to check if the object is null before calling the method.
How can I check this as I have
var _bllEntities = new BLLEntities(); declared right after the class namespace. I cannot use if or switch.
Thank you!!
Illegal Operation
|
|
|
|
|
Illegal Operation wrote: It is at this line where VS tells me that the Type initializer for DAL.Method threw an exception
The exception is coming from lower down the stack. Check the stack trace property of the exception to pin down exactly where it is coming from. It's possible it's coming from somewhere that you don't have loaded in code, or it's being handled and then re-thrown from lower down.
Try changing the visual studio options to break on all exceptions (Click Debug->Exceptions, Tick the Common Language Runtime Exceptions box, Click OK)
Simon
|
|
|
|
|
I have figured out that there is a problem with the app.config file. I have changed my connectionstring in the DataAccessLayer and now the error is gone.
Can you maybe tell me how can I reference a dataset from the DAL in the BLL? When executing my code everything works in the DAL and the return dataset is populated, but as soon as I step into the BLL the Dataset is null. I am using a property but the set never gets executed.
Thanks!!
Illegal Operation
|
|
|
|
|
Illegal Operation wrote: Can you maybe tell me how can I reference a dataset from the DAL in the BLL?
I haven't really got any ideas, without looking at your code it's a bit tough. Sorry.
Illegal Operation wrote: but as soon as I step into the BLL the Dataset is null
How are you returning it. Normal return, 'Ref' parameter or 'Out' parameter?
Illegal Operation wrote: I am using a property but the set never gets executed
This sounds like your not quite using properties properly. (Maybe I've just misunderstood what you are saying). The set property is called to set the value, the get property is called to retrieve the value. from inside the DAL class, you would just set the value to the internal member, and probably not call through the property. Then from outside the DAL class, you would only call the get property.
Sorry I can't be much more help.
Simon
|
|
|
|
|
Hi,
I created a Datagridview which holds the 64 bit data with different names, I want to display the Starting bit information on the Row header and the 0th column the name, and the value in the 1st column, How I can add the Header text?
SomaShekhar
|
|
|
|
|
I have no idea what you're trying to do, but the DGV has a Columns collection that holds DataGridViewColumn objects, each of which has a HeaderText property where you set the text of the column header.
|
|
|
|
|
Hi Dave,
My intention is to display the start index of the bit field at left side of the datagridview (I think it was called as the DataGgridviewRow header), I have tried setting the row header text but I couldn't acheived the purpose.
SomaShekhar
|
|
|
|
|
You voted me down because my suggestion didn't help at all, even when I said what you described didn't make any sense and I took a guess at what you were trying to do?? See ya...
|
|
|
|
|
Hmmm, I think I'll pass helping him out.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Hi,
I am writing code to reload the last active items and windows of the application, Basically I have 4 windows 2 are datagridview , 1. listview, 1 is tree view, in these 4 windows I can able add data from different files based on user selection. I need to reload all this when the application is restarted. currrently I am writing manually all data into the file and saved the file path location in windows registry, I felt it is very time consuming, and don't now how to improve the timimg, please provide your inputs is there a way to do this job in a simple manner.
SomaShekhar
|
|
|
|
|
It sounds to me that you're on the right track. Saving state is really never easy. What I have done is created a UserPreference class for my apps. This is simply a class the encapsulates a the Dictionary<> object, which is new to .Net 2.0
What I do is init the dictionary like this:
C#: Dictionary<string,> preference = new Dictionary<string,>;
With the "preference" object, you can specify a unique string for the key and use it to store and retrieve as many items as necessary to restore the program state. This code model is not as messy but you will always have to do some "manual labor"!
Cheers,
Richard
I've used up all my sick days, so today I'm calling in dead.
|
|
|
|
|
Hi Richard,
Thanks for your reply, I am not still clear, whether do I need to manually write all the forms information? if not could you please provide a code snippet how to avoid the manual updation.
Thanks
SomaShekhar
|
|
|
|
|
If there is any automatic save option, I don't know of it. Even if there was one provided by MS, it would generically store too much data and make the file size too large. For example, you don't want to be storing every attribute of the listView object: Font, BackColor, ForeColor, Items etc.
Here's a generic example to illustrate the preference class:
//Save the form's background color
preferences.Add("windowsBColor", this.BackColor);
--------
//Restore the windows backcolor
if (preferences.ContainsKey("windowBColor"))
{
this.BackColor = (Color)(preferences["windowBColor"]);
}
If you need further assistance, don't hesitate to ask.
Cheers!
Richard
My code this week has no errors. But it's Monday morning and I haven't got out of bed.
|
|
|
|
|
Hi guys, I've written an application in pure C++ and the command line and now I'd like to convert it to Windows.
I am at the very first steps in using Windows Forms and I am wondering if anyone could be kind enough to help.
To simplify the problem, let's suppose my application is composed of 2 input edit text boxes (Box1, Box2), a button (Calculate), and 1 output textbox (Box3). What is the correct code required to display the result of the calculation (Box1+Box2) in the output textbox (Box3)?
I've read 1300 pages of the excellent Ivor Horton's Beginning C++ 2008 book....only to discover that this simple topic is not covered!!
Many thanks
jEDI
|
|
|
|
|
J_E_D_I wrote: I've read 1300 pages of the excellent Ivor Horton's Beginning C++ 2008 book....only to discover that this simple topic is not covered!!
Really?? Somehow, I doubt converting a string to a number wasn't covered. Perhaps the Parse methods of the Int32 struct or the Convert class may help.
|
|
|
|
|
Can we add Listbox control to Datagridview column at run time??
Thankq
|
|
|
|
|
You can add a DropDownList if it helps
|
|
|
|
|
I try to write my own Paint program , and I wonder how to create the "layer system" , like Photoshop , Paint.NET 's features , I try to draw multiple stacked images on form , but it just works terribly .
Anyone got an idea of how to do it ? Thanks ^^
|
|
|
|
|
You may want to take a look at the source code for Paint.Net
The last time I saw it it was open source.
|
|
|
|
|
I got the Paint.Net source code , but without any idea in my mind , reading these codes just waste time and bring headache ^^ , anyone got ideas of how to do this ??
|
|
|
|
|
Having headaches is part of becoming a computer programmer so you might as well get use to it
Go into detail with what you have already attempted as far as layered graphics and the forums might be able to guide you based on the skills that you are showing with what you have tried so far. As you can tell layered graphics can get as complicated as Paint.NET (not to mention Photoshop), or they can be fairly simple. It just matters with how much time you want to put into the application.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|