C
C#β€’2y ago
PhoenixXeme

❔ Error

what dose this error mean because i have no idea
32 Replies
ZacharyPatten
ZacharyPattenβ€’2y ago
we need more info/context. when is the error happening? when you try to open a windows forms designer?
Omnissiah
Omnissiahβ€’2y ago
i guess he was creating his component
PhoenixXeme
PhoenixXemeOPβ€’2y ago
when i drag the control form onto form1
PhoenixXeme
PhoenixXemeOPβ€’2y ago
ZacharyPatten
ZacharyPattenβ€’2y ago
share your code for DarkRPReportForm
PhoenixXeme
PhoenixXemeOPβ€’2y ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Scarlet_Nixie
{
public partial class DarkRPReportForm : UserControl
{

NotepadForm notepadForm;

public DarkRPReportForm(NotepadForm notepad)
{
notepadForm = notepad;
InitializeComponent();
}

string name = "";
string steamID = "";
string link = "";

private void btnReportName_Click(object sender, EventArgs e)
{
name = btnReportName.Text;
}

private void tbReportName_TextChanged(object sender, EventArgs e)
{

}

private void btnReportID_Click(object sender, EventArgs e)
{
steamID = tbReportID.Text;
}

private void tbReportID_TextChanged(object sender, EventArgs e)
{

}

private void btnReportLink_Click(object sender, EventArgs e)
{
link = tbReportLink.Text;
}

private void tbReportLink_TextChanged(object sender, EventArgs e)
{

}

private void btnReportDone_Click(object sender, EventArgs e)
{
notepadForm.tbNotepadMain.Text = $"In-game name: PhoenixXeme \r\nName of the player(s) you are reporting: {name}\r\n\nSteam ID of the player(s) you are reporting: {steamID}\r\nHave you or the other player(s) involved made an in-game report to resolve the issue? No Admins\r\nIf so which staff member handled the report? None\r\nServer(wipe or main server): Server 2\r\nDate of the event (dd/mm/yy): \r\nTime of the event (BST): \r\nAny details regarding the event: No\r\nAny evidence to support your case: {link}";
this.Hide();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Scarlet_Nixie
{
public partial class DarkRPReportForm : UserControl
{

NotepadForm notepadForm;

public DarkRPReportForm(NotepadForm notepad)
{
notepadForm = notepad;
InitializeComponent();
}

string name = "";
string steamID = "";
string link = "";

private void btnReportName_Click(object sender, EventArgs e)
{
name = btnReportName.Text;
}

private void tbReportName_TextChanged(object sender, EventArgs e)
{

}

private void btnReportID_Click(object sender, EventArgs e)
{
steamID = tbReportID.Text;
}

private void tbReportID_TextChanged(object sender, EventArgs e)
{

}

private void btnReportLink_Click(object sender, EventArgs e)
{
link = tbReportLink.Text;
}

private void tbReportLink_TextChanged(object sender, EventArgs e)
{

}

private void btnReportDone_Click(object sender, EventArgs e)
{
notepadForm.tbNotepadMain.Text = $"In-game name: PhoenixXeme \r\nName of the player(s) you are reporting: {name}\r\n\nSteam ID of the player(s) you are reporting: {steamID}\r\nHave you or the other player(s) involved made an in-game report to resolve the issue? No Admins\r\nIf so which staff member handled the report? None\r\nServer(wipe or main server): Server 2\r\nDate of the event (dd/mm/yy): \r\nTime of the event (BST): \r\nAny details regarding the event: No\r\nAny evidence to support your case: {link}";
this.Hide();
}
}
}
ZacharyPatten
ZacharyPattenβ€’2y ago
you have to have a cunstructor with no parameters add a public DarkRPReportForm() {}
PhoenixXeme
PhoenixXemeOPβ€’2y ago
i keep hearing about cunstructors but i have no idea what they are
ZacharyPatten
ZacharyPattenβ€’2y ago
constructors are special methods. the ones where the name of the method is the same as the name of the type
PhoenixXeme
PhoenixXemeOPβ€’2y ago
ZacharyPatten
ZacharyPattenβ€’2y ago
that is a constructor yes but you also need one that takes no parameters
PhoenixXeme
PhoenixXemeOPβ€’2y ago
oh
PhoenixXeme
PhoenixXemeOPβ€’2y ago
PhoenixXeme
PhoenixXemeOPβ€’2y ago
so like that?
ZacharyPatten
ZacharyPattenβ€’2y ago
add InitializeComponent(); too inside the new constructor
PhoenixXeme
PhoenixXemeOPβ€’2y ago
is that it?
ZacharyPatten
ZacharyPattenβ€’2y ago
save it and try to add it to your form again
PhoenixXeme
PhoenixXemeOPβ€’2y ago
still get this
ZacharyPatten
ZacharyPattenβ€’2y ago
also, you generally shouldnt be putting forms inside of forms you should be making user controls
PhoenixXeme
PhoenixXemeOPβ€’2y ago
it is a user control
ZacharyPatten
ZacharyPattenβ€’2y ago
good πŸ™‚ try rebuilding your code
PhoenixXeme
PhoenixXemeOPβ€’2y ago
i did and i cleaned it
ZacharyPatten
ZacharyPattenβ€’2y ago
okay well you still messed something up but it is hard to tell what without seeing it. can you share the full code? preferably via github repo link
PhoenixXeme
PhoenixXemeOPβ€’2y ago
i cant due to it having some personel stuff on it
ZacharyPatten
ZacharyPattenβ€’2y ago
understood, but that will make it harder for us to help are you sure the code is building without any errors?
PhoenixXeme
PhoenixXemeOPβ€’2y ago
ZacharyPatten
ZacharyPattenβ€’2y ago
sorry I am out of ideas at the moment without being able to see the full code and replicate the issue. when you run into issues like this, sometimes it is a good practice to strip things down into a smaller example that still replicates the issue. if you did that then you could share the stripped down version of code that is having the issue with us
Patrick
Patrickβ€’2y ago
@phoenixxeme is this for GMod DarkRP?
PhoenixXeme
PhoenixXemeOPβ€’2y ago
what told you that XD
PhoenixXeme
PhoenixXemeOPβ€’2y ago
@ZP β–‘β–’β–“β–ˆβ”œβ– ΜΆΛΎΜΆΝžβ– β”€β–ˆβ–“β–’β–‘ when i remove "this" and the "NotepadForm notepad" arg it works and lets me drag it
PhoenixXeme
PhoenixXemeOPβ€’2y ago
Accord
Accordβ€’2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server