15,895,667 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by h7h7h7 (Top 63 by date)
h7h7h7
12-Oct-13 4:46am
View
if there in a text are other word except good show all.....ok a write good in text box and than all the word that are next show me......good can be every where in a text......I am new in C#...and the problem seems to be not so difficult
h7h7h7
12-Oct-13 3:22am
View
Andi, I dont have rules. I open e text file in a rich box(now I can see a text). Near to rich box, I put a text boxt to write a word that is in a text, then I put button and all I want is when I click it if a word was ''very'', then application should reply me what is next word..
I write a code to find double word e.x Hi Andi, are you, why not....etc...but I am blocked in a problem above, from one given word, to find wich next...if you want i can write my code for finding double word, maybe it could give you an Idea.
h7h7h7
12-Oct-13 3:09am
View
Hi Andi, Ok how you so can make this solution, any Idea.
h7h7h7
8-May-12 8:21am
View
it is ok man, I solved it using orderByDescending ....
thnx a lot
h7h7h7
8-May-12 8:05am
View
thnx it work but they are grouping from small value to high value like that:
AAA[1]
BBB[2]
CCC[3]
what should I change in code to group from high value to small value like that:
CCC[3]
BBB[2]
AAA[1]
thankyou so much
h7h7h7
4-May-12 5:18am
View
hmmm I have no doubt that this code isn't working, but I think I don't know to implement it, can you halp me where to set those code in wich part:
timer1.interval=1000;
progressbar.step=25;
then I din't understand that: In tick event handle value
the other code I have implement all..
h7h7h7
3-May-12 11:54am
View
hi Sandeep, how can i do that code: when I click in a buttton "sort", the data should not be sorted until the progresbar end. after e progresbar ende then I want to show data in a listbox1. that'is something same when you delete any file and a progesbar start during they are deleting
h7h7h7
3-May-12 11:51am
View
in fact it works, but data are sorted first then progresbar start :(....
I mean the progresbar must start first then data to be sorted
h7h7h7
30-Apr-12 11:34am
View
thnx man I found it in google, but there no examples hot to use bubble sort in windows form when data are in a listbox ??
h7h7h7
30-Apr-12 11:33am
View
dear Pete, no I won't use, I just want to compare bubble sort with quick sort and other sort.
thnx man :)
h7h7h7
29-Apr-12 18:09pm
View
I solved thnx man
I used : label1.text= wordcount.tosring();
h7h7h7
29-Apr-12 18:04pm
View
I understand now if I want to show number of word in labbel ?
label1.text=.....???? ( what code ? )
h7h7h7
29-Apr-12 17:22pm
View
but what code should I use if I want to count words..?
that mean nothing :S
h7h7h7
29-Apr-12 16:25pm
View
Thnx Wes, you always criticize me for bad description :D...thnx man
h7h7h7
23-Apr-12 17:13pm
View
I have tried that :S :S
h7h7h7
23-Apr-12 17:07pm
View
string[] dataFromFile = lstQiftet.Items.Cast<string>().ToArray();
ArrayList arr = new ArrayList();
foreach (string s in dataFromFile)
I tryied s.remove(".").... s.TrimEnd(".")...... dont work
h7h7h7
22-Apr-12 19:08pm
View
thnx it work but with a small problem... the code is this :
progressBar1.Minimum = 0;
progressBar1.Maximum = 100;
progressBar1.Value = 70;
progressBar1.PerformStep();
timer1.Enabled = true;
List.Sort();
listBox1.DataSource = List;
what should I change, if I want first to be filled progress bar, and after that in listbox1 to see data sorted...... and not in the same time I click button and data are in listbox during the progress bar is filling
h7h7h7
22-Apr-12 4:40am
View
THnx Thnx that work, but now after I delete "-----" , in first line is an space, I Try to delet that space like your code it isn't working.....
if (!s.StartsWith("-")&&!s.StartWith(" " ))..... is here any mistake or should be another code
h7h7h7
21-Apr-12 17:50pm
View
I am stuck, there that I am using a lot of codes and I cant remove this string "------"..... look codes above ore below maybe you can help me
h7h7h7
21-Apr-12 12:43pm
View
string[] dataFromFile = lstQiftet.Items.Cast().ToArray();
Array.Sort(dataFromFile);
listBox1.DataSource = dataFromFile;
ArrayList arr = new ArrayList();
foreach (string s in dataFromFile)
if (s != "-----------------")
arr.Add(s);
arr.Sort();
listBox2.DataSource = arr;
why doesn't wor
h7h7h7
21-Apr-12 12:43pm
View
Deleted
It still doesn't work look my code:
string[] dataFromFile = lstQiftet.Items.Cast<string>().ToArray();
string[] dataFromFile = lstQiftet.Items.Cast<string>().ToArray();
Array.Sort(dataFromFile);
listBox1.DataSource = dataFromFile;
ArrayList arr = new ArrayList();
foreach (string s in dataFromFile)
if (s != "-----------------")
arr.Add(s);
arr.Sort();
listBox2.DataSource = arr;
why doesn't work
h7h7h7
21-Apr-12 7:13am
View
hmmm do you minde to give a small example pls
h7h7h7
21-Apr-12 6:54am
View
Thankyou, but I think you are not understanding me listen dear frien. I have to listboxes
ListBox1 that have this data:
CCCC
----
BBBB
----
AAAA
----
and listbox2 that is empety......I just want, when I click in button in listbox2 to have those data sorted without "---------------"....I have code for sortin them, But I don't know how to write code that ok sort data but dont take this string "-------------------".....
h7h7h7
21-Apr-12 5:11am
View
Deleted
Can you be more specifike about that.. I am trying to implement but I cant
So I have listbox with item " listbox1.datasource=datafile" this codo get elements and put them in listbox1, now from this list box that is:
AAAAA
-----
BBBBB
-----
I want to remove those lines "-------"; how is that impposible when datasource is assigned ?
h7h7h7
20-Apr-12 12:56pm
View
hmmmm in fat that code works, but when I clik button Sort...there is nothing
sorted....there are no data ?
h7h7h7
20-Apr-12 7:23am
View
It's the same again.... :(
h7h7h7
20-Apr-12 6:22am
View
haha yes it is Gomoz..
Andy, my data are in listbox, I don need to create new list...
I tried
var sortedlist=listbox.item.OrderBy(s => s).
Where(s => !(s.Contains("----") || s.Contains(" ")));
but listbox.item.( here orderby is unkonwn, what should I do )..
h7h7h7
20-Apr-12 5:44am
View
Yes, I know about trim function, but string[] data.... (array) doesn't support
trim, replace, or remove....!??
is there other opportunity ?
h7h7h7
20-Apr-12 4:43am
View
p.s
So when I click the button the sorted should be"
Cristiano Ronaldo
Karim Benzema
Lionel Messi
Mario Gomes
Rikardo Kaka
Van Persi
I am using array.sort(data) ... but it doesnt work if I want to remove "------" as I mention in first comment
h7h7h7
19-Apr-12 4:14am
View
thnx Mohammad !
h7h7h7
19-Apr-12 4:09am
View
Thankyou...! :)
h7h7h7
19-Apr-12 4:09am
View
Yes it was a correct answer
Thankyou!
h7h7h7
18-Apr-12 8:16am
View
No man it isn't I fine the source code and I execute it and it workd...so I brows a file from a dektop .doc file....and then when I click a button SHOW...in a text box I can see the data inside the .doc file....But I dont now why to that work and in my app dont work
h7h7h7
18-Apr-12 7:41am
View
and when I insert that library and those dll file it works
here is a code:
Word.Document doc = app.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
IDataObject data = Clipboard.GetDataObject();
string text = data.GetData(DataFormats.Text).ToString();
Console.WriteLine(text);
doc.Close(ref nullobj, ref nullobj, ref nullobj);
app.Quit(ref nullobj, ref nullobj, ref nullobj);
h7h7h7
18-Apr-12 7:39am
View
Ok I understand you and I get it as solution. but there I find that there is an opportunity to read Word file..... I shoul use a library called mirosoft office library and some dll file like interop.word.dll .... but I don't know how to implement.
Bthw thnx :)
h7h7h7
17-Apr-12 9:53am
View
Yes, I understood you... the problem is that I can save in .doc format without problem, but I cant read it....!??
h7h7h7
17-Apr-12 3:14am
View
Mohammad in this part of code "result.Add(innerList);" there is an error ??!
I have tried to solve but I cant't ?? ande here too " innerList.Add(arr.ElementAt(i))"
h7h7h7
16-Apr-12 18:21pm
View
I am sory for les info. So I have file data.txt (with a text inside)...I have a code to make array with double words....ex "tomorrow is god day", my code do that: tomorrow is
is god
god day
and the code is:
string text= File.ReadAllText(textbox1.Text,System.Text.Encoding.Default);
List<string> word= new List<string>(textbox1.Split(' '));
word.Remove("");
List<string[]> double= new List<string[]>();
for (int i = 0; i < word.Count; i++)
{
if (i + 1 < word.Count)
double.Add(new string[] { word[i], word[i + 1] });
else
double.Add(new string[] { word[i], ""});
}
// listbox1.Items.Clear();
foreach (string[] doub in double)
{
listbox1.Items.Add(doub[0] + " " + doub[1]);
}
I don't know hot to make with three word:
tomorrow is god
is god day.
h7h7h7
16-Apr-12 17:20pm
View
that should be..."string[] dataFromFile = lstQiftet.Items.Cast<string>().ToArray();"......
THnx Richard
h7h7h7
16-Apr-12 10:38am
View
yes ye Richard I am still on it. I have a listbox with items, now this items I have to sort and so sorted to put in another listbox...! I have problem to implement in a code I have idea....!
h7h7h7
16-Apr-12 10:14am
View
Yeah. My english is not so good. I looked in that link but i didn't solve the problem. I just want the data in the list box to save in a any variable and then this variable to equal with another listbox...( I think you didn't understand me again )!
h7h7h7
16-Apr-12 9:59am
View
Yes I ssw it, but there are more explained things in common....there are only one short work.....who work more with c# can solve it
h7h7h7
16-Apr-12 6:46am
View
This solution and solution 4 work.
Thnx friends !
h7h7h7
16-Apr-12 6:45am
View
Thnx it works ! :)
h7h7h7
16-Apr-12 6:27am
View
to replace with what...?
e.x I want to remove ".".... replace(".", " " ); you think like that.
h7h7h7
16-Apr-12 3:56am
View
It works, thanks to all,...I have done a combination of code from VJ and Mohammad...thnx thnx GOD Bless you !
Thnx Shahin !
h7h7h7
16-Apr-12 3:42am
View
Deleted
I have buton when i click this open me openfiledialog, I chose a file "data.txt
"...the name in this file then I put in a list1box..so now names are in list box. Know I want from that listbox with names to make that code that we are trying to do. but always in windowsform, not console.......thnx to all !
h7h7h7
15-Apr-12 17:29pm
View
I can't believe, I think I have the right code but I cant implement it.
VJ Reddy I didn't need to add items in list, I already have them in a list, I just need to count those items and then to another list to put them...
So I think I don't need this code:
List<string> names = new List<string>(){
"Cristiano Ronaldo", "Lione Messi",
"Van Persi", "Karim Benzema", "Lione Messi",
"Cristiano Ronaldo", "Cristiano Ronaldo"};
But in this part how cant read items in a listbox that are already and then to
Sory I ask a lot.... have the result e.x
//Cristiano Ronaldo [3]
//Karim Benzema [1]
//Lione Messi [2]
//Van Persi [1]
h7h7h7
15-Apr-12 17:25pm
View
I can't believe, I think I have the right code but I cant implement it.
VJ Reddy I didn't need to add items in list, I already have them in a list, I just need to count those items and then to another list to put them...
So I think I don't need this code:
List<string> names = new List<string>(){
"Cristiano Ronaldo", "Lione Messi",
"Van Persi", "Karim Benzema", "Lione Messi",
"Cristiano Ronaldo", "Cristiano Ronaldo"};
But in this part how cant I take the iteme that are already in listbox...
Sory I ask a lot..
h7h7h7
15-Apr-12 11:11am
View
Thnx Shahin I think I understand, but you should help me now if I want the result to put in a listbox (not using console form, but windows form) .
h7h7h7
15-Apr-12 11:02am
View
I know it Wes Aday you are right, But I am in that situation that I need to do it quickly...when I have more time, I will try everything to do alone without others help. THnx
h7h7h7
15-Apr-12 10:52am
View
I can get a data from a file, those data I put in list box and the result is ex:
AAA
AAA
AAA
BBB
CCC
CCC
and now I want to count them and put to another textbox or listbox like that:
AAA [3] .... "is repeat three times"
BBB [1] ... "is repeat one time "
CCC [2] ... "is repat two time"
CCC [1]
h7h7h7
15-Apr-12 10:49am
View
Ok let me explain again you ( I will try it now, what u say )....I have a text file, I call it and all data are in a list box. So from this listbox know I need to count the number of entries, but I didn't need to add new name. All the problem is that I can't do that code from "Console Apliction" to "windows form"... If you can help me in this part ?? ( I am really not so good in c#, but I have to do that )...thnx
h7h7h7
15-Apr-12 10:27am
View
Richard, I am not so good in c#, I need a code in windows form...
So based in the case above can write a simple code here about that problem !
h7h7h7
15-Apr-12 5:37am
View
I solve the problem thnx to all.....I just should use this code " System.Text.Encoding.Default" ..... thankyou
h7h7h7
15-Apr-12 5:37am
View
I solve the problem thnx to all.....I just should use this code " System.Text.Encoding.Default" ..... thankyou
h7h7h7
15-Apr-12 5:36am
View
I solve the problem thnx to all.....I just should use this code " System.Text.Encoding.Default" ..... thankyou
h7h7h7
15-Apr-12 5:14am
View
Yes Shahin, I follow it... original text where I put it in a textbox there is ok with characters, but when I make words double there is a problem..... e.x
Kosovë is a small contry in europe.( that is a file data.txt) when I put it in textbox there is no problem with "ë"...
Now the problem is when I split this sentences like that:
Kosov ● is
is a
a small
small country
so when a make double words this character " ● " is in a place of "ë"
h7h7h7
14-Apr-12 16:05pm
View
Shahin thnx.... but I cant repair it still..... can you explain short....what ecaxtlu should I do..!
h7h7h7
14-Apr-12 13:58pm
View
Where should I check it ??
h7h7h7
14-Apr-12 12:47pm
View
haha thankyou man, I think I have solved the problem with your help...
I think latter I should Ask you something else...... please can you write me in besartosmani1@gmail.com I will sent you my code...!
thank you
h7h7h7
14-Apr-12 12:43pm
View
Thankyou very much friends, it works.....
My professor told me to look for a standard class in c#, tha will be the same for all textfile.... but I think like OriginalGriff. in this case we dont need class...
Thank you !
h7h7h7
14-Apr-12 12:33pm
View
Dear friend, I don't have experience so much in c#...as I so you can help me.
I describe again the problem.
I have a text file in Desktop called data.txt with names and surnames. My problem is to read this file as you say "File.ReadAllLines(fileName);" and then to compare the data in file and to sort them...those name and surnime that are the same to collect together e.x
Besart Osmani
Besart Osmani
..
..
after sorting these word to put in a listbox...
I hope you understand what I need ... ! thankyou
Show More