Click here to Skip to main content
15,901,853 members
Home / Discussions / C#
   

C#

 
AnswerRe: Why does the DataTable get strings do not exceed 255 characters ? Pin
jschell30-Jul-18 13:02
jschell30-Jul-18 13:02 
GeneralRe: Why does the DataTable get strings do not exceed 255 characters ? Pin
Gerry Schmitz31-Jul-18 12:58
mveGerry Schmitz31-Jul-18 12:58 
GeneralRe: Why does the DataTable get strings do not exceed 255 characters ? Pin
jschell19-Aug-18 6:06
jschell19-Aug-18 6:06 
AnswerRe: Why does the DataTable get strings do not exceed 255 characters ? Pin
Gerry Schmitz31-Jul-18 13:01
mveGerry Schmitz31-Jul-18 13:01 
Questionc# Stream reader text file split line into first side int, and the other side string Pin
Member 1392985029-Jul-18 4:16
Member 1392985029-Jul-18 4:16 
AnswerRe: c# Stream reader text file split line into first side int, and the other side string Pin
OriginalGriff29-Jul-18 6:09
mveOriginalGriff29-Jul-18 6:09 
QuestionCustom control not visible on parent control Pin
Ömer3328-Jul-18 11:30
Ömer3328-Jul-18 11:30 
AnswerRe: Custom control not visible on parent control Pin
Luc Pattyn28-Jul-18 13:17
sitebuilderLuc Pattyn28-Jul-18 13:17 
Hi,

your code is pretty weird. I'll skip many details, and make only a few remarks.

1.
For one, InpbBeskrivelseTxtBox is not a TextBox, it isn't even a Control. Yes, it has a field that holds a TextBox, but that does not turn it into a TextBox.
Therefore
control.Controls.Add(BeskrivelseTextBox);
will never succeed, as the AddMe() method expects a Control. So I guess your code won't compile.

What you really want is have class InpbBeskrivelseTxtBox implement a TextBox, a specialized one.
So you should start off with
class InpbBeskrivelseTxtBox : TextBox {...}
and remove the TextBox field inside that class; the class itself now is a TextBox, which you can add to a parent Control.

When you do this, InpbBeskrivelseTxtBox automatically inherits all the Properties a TextBox has, so you'll have to organize your initialisation a bit differently, and maybe assign appropriate values in the constructor.

Custom Control: Numeric TextBox: TextBox that alow you to enter only numbers[^] is a short CodeProject article that demonstrates how things could be done. I would suggest you read it.

2.
If you are new to Windows user interface programming, I'd recommend buying and studying a book on the matter, most any C# book should do. Learning from a book may seem a slow process, but trust me it is the fastest way to get acquainted with the proper way of doing things.

3.
Visual Studio offers a choice what to do when compile errors occur; one option is to run the previous version, it once was the default, maybe it still is, I don't know. This is very bad, as it executes an exe that does not match your current source files. Look for the option (probably menu Tools/Options/Projects and Solutions/Build and Run/On Run when errors occur), and make sure it is set to "Do not launch". That will avoid lots of grief, enforcing compilable source code before you can even attempt to run or debug.


Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum


modified 28-Jul-18 21:55pm.

AnswerRe: Custom control not visible on parent control Pin
OriginalGriff28-Jul-18 20:24
mveOriginalGriff28-Jul-18 20:24 
AnswerRe: Custom control not visible on parent control Pin
Gerry Schmitz31-Jul-18 13:19
mveGerry Schmitz31-Jul-18 13:19 
Questionread text file online c# Pin
Luiz Carlos27-Jul-18 9:40
Luiz Carlos27-Jul-18 9:40 
AnswerRe: read text file online c# Pin
Dave Kreskowiak27-Jul-18 13:47
mveDave Kreskowiak27-Jul-18 13:47 
AnswerRe: read text file online c# Pin
OriginalGriff27-Jul-18 20:19
mveOriginalGriff27-Jul-18 20:19 
GeneralRe: read text file online c# Pin
Gerry Schmitz28-Jul-18 8:00
mveGerry Schmitz28-Jul-18 8:00 
QuestionGetting first paragraph of wikipedia using Voice C# Pin
Wishingchain26-Jul-18 20:58
Wishingchain26-Jul-18 20:58 
AnswerRe: Getting first paragraph of wikipedia using Voice C# Pin
Pete O'Hanlon26-Jul-18 22:45
mvePete O'Hanlon26-Jul-18 22:45 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Wishingchain26-Jul-18 23:57
Wishingchain26-Jul-18 23:57 
AnswerRe: Getting first paragraph of wikipedia using Voice C# Pin
Eddy Vluggen27-Jul-18 0:06
professionalEddy Vluggen27-Jul-18 0:06 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Wishingchain27-Jul-18 18:04
Wishingchain27-Jul-18 18:04 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Eddy Vluggen27-Jul-18 23:47
professionalEddy Vluggen27-Jul-18 23:47 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Wishingchain28-Jul-18 1:03
Wishingchain28-Jul-18 1:03 
GeneralRe: Getting first paragraph of wikipedia using Voice C# Pin
Eddy Vluggen28-Jul-18 1:27
professionalEddy Vluggen28-Jul-18 1:27 
AnswerRe: Getting first paragraph of wikipedia using Voice C# Pin
CP_Member88829-Jul-18 19:25
CP_Member88829-Jul-18 19:25 
QuestionPlotting a line graph in c# and retaining the previous graphs. Pin
Dipk1123-Jul-18 0:51
Dipk1123-Jul-18 0:51 
AnswerRe: Plotting a line graph in c# and retaining the previous graphs. Pin
OriginalGriff23-Jul-18 2:04
mveOriginalGriff23-Jul-18 2:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.