|
a listbox holds items, not necessarily strings; listbox items can take whatever height you want (constant or variable), and can look however you like. So that is not an issue. The main characteristic is: all items are arranged vertically, and there is no speed penalty as the content grows.
|
|
|
|
|
The problem with listbox is that you can only select an item, I'm trying to find out the item the selction is in.
I will be playing with some rtf stuff over the weekend, to see what happens. I are sad, I have downloaded the frakin rtf specification.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
I have played around quite a bit with RTF. It is a huge spec; and Word, as usual, is abusing it all the way. Stay away from Word if you can!
WordPad however is pretty decent, and it can display (and to some extent let you modify) things you can't create with WordPad, e.g. tables.
FWIW: to concatenate two RTF documents, put one in an RTB, then paste the second one into it, then save.
PS: don't consider an RTB for 10MB+ documents, it sucks big time.
|
|
|
|
|
Luc Pattyn wrote: don't consider an RTB for 10MB+ documents, it sucks big time.
I know
The final content being displayed is rarely going to be >1m, but the source files are occassionally pretty big.
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
I've never used an RTB but can't you insert your item identifier tokens into the text, detect the position of the user click/selection and just work back through the text to find the token
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi,
I have to develop a cross platform C# GUI application,
I had read many form regarding to cross platform
application development I found Code Block for C++.I need
similar for C#.I need to develop Good GUI application.
Please help me choose Good IDE.
Regards,
Pavan,,
Freelancer( Independent Programmer ).
modified on Friday, July 2, 2010 11:31 AM
|
|
|
|
|
You will probably need to learn about Mono[^].
It's time for a new signature.
|
|
|
|
|
|
Hi
I have a chart control and have my y axis format like this:
Chart1.ChartAreas(0).AxisY.LabelStyle.Format == "C"
Which will show me (£ 100,£200 etc..).
I have set the .Series("Revenue").IsValueShownAsLabel = True
when i See the graph the numbers is formated for the the £ sign.
However the point values for the y axis has not been formated with £ sign.
How can i add a £ sign to each numbers of the Y values.?
Please advice.
|
|
|
|
|
Hi
I've got a desktop application that uses a WebBrowser control to let users access their Gmail accounts. I have multiple users though, and every time a users logs out of the desktop application, and a new user logs in, the WebBrowser goes to the previous users email account. How can I reset the the WebBrowser completely so that it navigates to the Gmail homepage? I tried clearing the cookies as well as the temporary internet files folder (I tried this programmatically in code as well as using the Windows way), but still no luck. It still navigates to the previous users email account. What is strange though is that when I close down the desktop application completely and run it again, the WebBrowser navigates to the Gmail homepage.
Any ideas?
|
|
|
|
|
after the user finished, set the instance of the web browser to null then call the garbage collector System.GC.Collect();
|
|
|
|
|
Thanks for the quick reply.
Okay so now when the next user tries to access his/her email, I call the following again:
this.browserGmail = new System.Windows.Forms.WebBrowser();
this.browserGmail.Location = new System.Drawing.Point(5, 53);
this.browserGmail.MinimumSize = new System.Drawing.Size(20, 20);
this.browserGmail.Name = "browserGmail";
this.browserGmail.Size = new System.Drawing.Size(914, 616);
this.browserGmail.TabIndex = 4;
browserGmail.Navigate("mail.google.com/mail");
This seems to work, but the browser doesn't get directed to any page, it just shows me a white screen?
So I tried:
browserGmail.CreateControl();
browserGmail.Update();
Still no luck
|
|
|
|
|
I did a research, i read the description of all the properties and methods in the WebBrowser class, and i didn't find a thing , i only thing that i manage to get is the credentials of users are saved on the disk not in the memory, and each application has its own place to save them with encryption, who manage this thing and how :S i don't know, sorry.
|
|
|
|
|
Hi,
I have drawn rectangle using picture box. Now i like to keep the work done and like to close the application. again when i open the application the previous work should come.
How to do this...
Please help me....thanks.
|
|
|
|
|
See here: Using Settings in C#[^]
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.
nils illegitimus carborundum
me, me, me
|
|
|
|
|
Hi sir,
I am using below in VC++
Combo.SetEditSel(i,i++);
Combo.SetDroppedWidth(j);
Combo.ShowDropDown();
How can i use the same in C#
Thanks
Raj
|
|
|
|
|
Just use the .Net ComboBox[^] in the same way.
It's time for a new signature.
|
|
|
|
|
I have a long string which I need to check its existence in database. The string is follows:
string str = AU000AC20095=YBAX ,XS0088980494=MLIL,IT0003953350=HVBT
To make it sql compliant like.
Following is the sql query I need to execute:
SELECT ISIN_Universe_Id,ISIN,RIC,DateCreated from ISIN_Universe where ric in
('AU000AC20095=YBAX','XS0088980494=MLIL','IT0003953350=HVBT')
So I declared a varchar variable and passing this string. In C# code, i am using the following function for this:
public string CreateRICList(RICObject[] ricobj)
{
StringBuilder sb = new StringBuilder();
sb.Append("'");
for (int i=0; i<=ricobj.Length - 1; i++)
{
sb.Append("''");
sb.Append(ricobj[i].RIC);
sb.Append("''");
sb.Append(",");
}
string lstrics = sb.ToString();
if (lstrics.EndsWith(","))
lstrics.Replace(",","'");
return lstrics;
}
However, the string is not forming correctly. Is there any issue with the above code? Or is there any other method which I can pass the whole string at a stretch? Please help.
This is my stored procedure:
EXEC ('SELECT ISIN_Universe_Id,ISIN,RIC,DateCreated from ISIN_Universe
WHERE RIC IN ( ' + ''+ @LISTOFRICS + ''+ ')
AND DATECREATED > ''' + @PREVDAY + ''' AND DATECREATED < '''+@NEXTDAY+'''')
Thanks
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
The issue fixed. The string manipulation function refactored as follows:
StringBuilder sb = new StringBuilder();
for (int i=0; i<=ricobj.Length - 1; i++)
{
sb.Append("'");
sb.Append(ricobj[i].RIC);
sb.Append("'");
sb.Append(",");
}
string lstrics = sb.ToString();
if (lstrics.EndsWith(","))
lstrics = lstrics.Remove(lstrics.LastIndexOf(","),1);
return lstrics;
Probably it will help somebody.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi...
I want to display analog clock.
I have a textbox . once I enter time in textbox and click button, the same time should be set on analog clock.
how would I proceed in windows application in C#.net.
I basically belong to webapplication community.
thanks,
By:
Hemant Thaker
|
|
|
|
|
|
Hi sir,
In VC++ we use str.Find();
How can we use the same in C#
Its working good in VC++
Here is the VC++ code i did:
CString strvalue;
CString strTemp;
for()
{
if(strTemp.Find(strvalue)==0)
m_ctrlCombo.AddString(strTemp);
}
I am trying the same in C#
But in C# we dnt have str.Find(),any other method to find it
Here is wat i am trying
ArrayList List = new ArrayList();
List.Add("AAA");
List.Add("AA");
List.Add("BB");
List.Add("BB");
for (int i = 0; i < List.Count; i++)
{
string value = List[i] as string;
if(value.Equals("AA"))
comboBox1.Items.Add(value);
}
but i am getting all the value from ArrayList.
Any idea
Thanks
Raj
|
|
|
|
|
You must try this out, if u really want to iterate :
ArrayList List = new ArrayList();
List.Add("AAA");
List.Add("AA");
List.Add("BB");
List.Add("BB");
foreach (string item in List)
{
if (item.Equals("AA"))
comboBox1.Items.Add(item);
}
else, u can always go with this :
ArrayList List = new ArrayList();
List.Add("AAA");
List.Add("AA");
List.Add("BB");
List.Add("BB");
if (List.Contains("AA")
comboBox1.Items.Add("AA");
Ram
|
|
|
|
|
If you you are using .net3.0 or higher you can use this:
List<string> list = new List<string>();
list.Add("AAA");
list.Add("AA");
list.Add("BB");
list.Add("BB");
foreach (string found in list.FindAll(x=> x=="AA"))
comboBox1.Items.Add(value);
The above code is one way if achieving what you want. The generic list (equivalent to a c++ template) has a few advantages, the list is strongly typed (in this case all elements are strings). Additionally the generic list has more methods allowing you to find stuff in the list over the old ArrayList . The only thing I'd say (and it's a drawback in the code snippet I've added) is that the predicate syntax looks a little weird if you aren't used to it: list.FindAll(x=> x=="AA")
See Generic List MSDN[^] for members of a generic lists if interested.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Not an answer to your question, but a suggestion.
An ArrayList is generally not recommended as every item has to be converted to/from a object . This boxing/unboxing is an unecessary performance hit and more importantly can make working with the items (and therefore the code) more complicated.
If the items are all of the same type then use List<T> (where T is the type of your object, so for the example you have given use List<string> . There are other collections in System.Collections.Generic and System.Collections.ObjectModel that you may find useful depending on what you are using the list for. I would recommend using the generic types where available or the ones that are type specific such as StringCollection .
If you have mixed classes that you want in a collection but they derive from a common base class or interface then you can have a collection of that eg: List<IMyBaseInterface> .
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|