15,888,579 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 Kleo Rogers (Top 28 by date)
Kleo Rogers
1-Apr-21 11:32am
View
Guys sorry to misled you I know about SQL injection this is the code so you can understand what I am trying to do First I declared the string for the button text second button text is not changeable so user will not be able to do any input but thank you guys for the explanation and time
Kleo Rogers
1-Apr-21 11:17am
View
Earth table
Kleo Rogers
1-Apr-21 7:44am
View
Text of the button is earth + $exception {"Incorrect syntax near 'earth'."} System.Data.SqlClient.SqlException
Kleo Rogers
1-Apr-21 7:41am
View
Deleted
Text of the button is earth + $exception {"Incorrect syntax near 'earth'."} System.Data.SqlClient.SqlException
Kleo Rogers
31-Mar-21 4:01am
View
yes but I am righting how many times the button will be clicked in the textbox 2
Kleo Rogers
31-Mar-21 3:24am
View
I need to copy the last line of the textbox1 and paste it in the same textbox that many times how much i wright it in textbox2
Kleo Rogers
27-Mar-21 18:32pm
View
They are coming from buttons so yes I have
Kleo Rogers
21-Mar-21 8:48am
View
If you spend this much time on me ofc I will vote Thank you for the time
And help
Kleo Rogers
20-Mar-21 4:39am
View
it will send a text to the button and rest of the buttons will be hidden and i will have just one button
Kleo Rogers
19-Mar-21 15:38pm
View
I tested your code it is still creating new buttons it is reading from the text file and creating that many buttons how many i have lines in text file
Kleo Rogers
19-Mar-21 15:38pm
View
It is same to me to have a command who will hide it or show the buttons so it is a not a problem to hide them at beginning
Kleo Rogers
19-Mar-21 13:36pm
View
it is a same to me to hide it or to show it
Kleo Rogers
19-Mar-21 13:26pm
View
it supposed to read lines fill the button text and hide the rest of the buttons
Kleo Rogers
19-Mar-21 12:52pm
View
I was thinking just to add text to the buttons from the line for example I have 4 line it will add text to 4 buttons and to hide rest
Kleo Rogers
19-Mar-21 12:45pm
View
@Richard MacCutchan this .txt is just for this question and in the real code i have full path and file name and this solution is for creating new buttons but i need it for exiting ones
Kleo Rogers
19-Mar-21 12:12pm
View
I don't Know sometimes will be 4 maybe more maybe less i need to leave that open
Kleo Rogers
19-Mar-21 12:09pm
View
string[] lines = File.ReadAllLines(@".txt");
i just didn't putt any name of the text file
string[] lines = File.ReadAllLines(@"mytextfile.txt");
Kleo Rogers
17-Mar-21 14:12pm
View
Thank you so much for you patience and help
Kleo Rogers
16-Mar-21 14:19pm
View
2013
Kleo Rogers
16-Mar-21 11:07am
View
First error is ok now but second is still there if I delete $ sign I don't have any error but it is not righting the correct text on button i just have {i} as a text
Kleo Rogers
16-Mar-21 10:46am
View
Deleted
Ok i Figure it out with the button text and the code is looking like this now
foreach (string line in File.ReadLines(@"Drinks.txt"))
for (int i = 0; i < line.Count(); i++)
{
//create an instance of button
Button btn = new Button(){Name="Button{i}", Text = line, Size = new Size(107, 55), Location = new Point(512, (55*i) + 10)};
//put it on the form
this.Controls.Add(btn);
but now it is creatin 7 buttons of 1 line 4 of the another and etc
Kleo Rogers
16-Mar-21 10:38am
View
Deleted
ok I figure it out with the button text but now i have 7 buttons of the same line
Kleo Rogers
16-Mar-21 10:23am
View
I have a error on
string[] lines = File.ReadLines(@"drinks.txt");
cannot implicitly convert type 'system.collections.generic.ienumerable to string an explicit conversion e4xist are you missing a cast
and on
$"Button{i} Syntax error ',' expected
i tried to play around with it and replace the string[] lines = File.ReadLines(@"drinks.txt"); with foreach (string line in File.ReadLines("drinks.txt")) remove the $ sign and get the buttons with text button {i} and get 12 buttons and i have 4 lines
Kleo Rogers
16-Mar-21 2:49am
View
So this will create count of lines and give me result to the label but that was the wrong way i need every line to rad and create that many buttons and and read the line and place every line as text in button text or i am reading this code wrong?
Kleo Rogers
29-Aug-19 6:16am
View
Thank you very Much
Kleo Rogers
29-Aug-19 5:58am
View
Yes but WIN 10 user will not bee on another computer
Kleo Rogers
29-Aug-19 5:54am
View
C:\Users\WIN10\AppData\Local\App folder\spp folder\app.exe
This is Full path so I don't need roaming folder
Kleo Rogers
29-Aug-19 5:47am
View
C:\Users\WIN10\AppData\Local\App folder\spp folder\app.exe
This is Full path so I don't need roaming folder
Show More