This is an example from http://msdn.microsoft. com/en-us/library/system.windows. forms.treeview( VS.80).aspx on how to populate the treeview
// Populates a TreeView control with example nodes.
private void InitializeTreeV iew()
{
treeView1.Begin Update();
treeView1.Nodes .Add("Parent");
treeView1.Nodes[0].Nodes.Add("Chi ld 1");
treeView1.Nodes[0].Nodes.Add("Chi ld...
User Profile
Collapse
-
Provided that the string contains a valid integer you can use this:
int yourint = System::Convert ::ToInt32(yours tring);
You can also use this, which is i guess an even better option:
int yourint;
if(System::Int3 2::TryParse(you rstring, yourint))
{
// do sth with the int <yourint>
}
else
{
// the string is not a valid int
}
hope that helps,...Leave a comment:
-
Pls write what version of .NET are you using, also is it a windows or web control?...Leave a comment:
-
Hi,
Try calling Application.DoE vents before the sleep line.
The answer to "why": for my (limited still) knowledge, it would have something to do with form events (paint, etc) - the real time they're being executed; pls someone elaborate on this;)
hope this helps
M....Leave a comment:
-
Hi,
The proper way to control whether to close a form in FormClosing event is to set the "e.Cancel" property:
- to false when you want to allow it to close
- to true to prevent closing
so as I understand, you want to do something like this:
Code:private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { OtherForm other = new OtherForm(); DialogResult
Leave a comment:
-
Hi Cyrak,
See the examples below;
In the file with your user control:
Code:public delegate void CloseRequestedDelegate(int id); // define the delegate public class UserControl { /* (...) */ private int m_id; // populated e.g. in the constructor /* control's published event */ public event CloseRequestedDelegate CloseRequested;
Leave a comment:
-
Hi,
what you're doing wrong is that you're using CheckBoxList1.S electedValue property for getting the value - it's showing list's first (of the lowest index) selected value instead of a "current iteration";
pls take a look at this example (from msdn, slightly modified) of iterating through Checkboxlist's items
Code:Dim i As Integer For i = 0 To checkboxlist1.Items.Count - 1
Leave a comment:
-
Hi,
One of the way of doing this would be:
- add a public event to your user control, let's say CloseRequested (this event could have e.g. a current's control id as a parameter)
- inside your control subscribe to button's Clicked event and inside the handler fire the CloseRequested event
- each time you're adding a new control on runtime, you need to subscribe to CloseRequested event...Leave a comment:
-
unfortunately or rather fortunately;) I was wrong about this one:
there's no datacolumn type as such, but you can specify content type to whatever is valid for you, e.g.:
Code:DataGridViewColumn column; column = new DataGridViewTextBoxColumn(); // here you specify what does each cell look and behave like, check documentation for other "looks" column.Name = "colName"; column.HeaderText = "header
Leave a comment:
-
Hi,
I also started using managed c++ not so long ago, so maybe someone more experienced could help you better;
but for a good start;) :
- you can use unmanaged objects in your managed class, even as members, e.g.
Code:public ref class Example { public: UnmanagedClass* m_member; // here it's important to use a pointer, otherwise the code won't compile };
Leave a comment:
-
in managed c++ the equivalent of NULL is nullptr
best regards,
M.Leave a comment:
-
Hi,
This may be connected to security handling in .net framework.
Check the details from the error window ("hello world encountered an error...") -
and if I'm right, it'll say something like:
"System.Securit y.SecurityExcep tion. Request permission (...)"
pls check the links, hopefully you'll find the solution there:
http://weblogs.sqlteam .com/jhermiz/archive/2007/08/14/60284.aspx...Leave a comment:
-
You can do it in CellValueChange d event;
As a parameter you'll get DataGridViewCel lEventArgs which has ColumnIndex and RowIndex properties
- this will point you to the cell changed;
then you can call your validating function and, if needed, reassign/reset the value of that cell (DataGridViewCe ll.Value)
I'm sure there are other ways to do this, but it worked for me
afaik, there's...Leave a comment:
No activity results to display
Show More
Leave a comment: