|
This article[^] explains how to do it with a ListView, but the concepts are the same. The implementation make work as is, after you change the base class to TreeView though.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Thanks a lot! I'll test this concept.
/ Erik
|
|
|
|
|
hello,
i want to send a net sent "test" message to a computer on the LAN by running a batch file.
Would anyone tell me the code for the required batch file, thanx in advance.
regards,
vat2do
|
|
|
|
|
Batch files are not written in C# or VB.NET, as far as I know. This means you're in the wrong forum.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I have a windows application and service. i have to monitor the service startuptype from windows application. Can any one help me in this regard.
thanks in advance
Sivakumar.V
i am software developer of Omnicell India Pvt Ltd at Bangalore
|
|
|
|
|
The ServiceController class gets you some of the service's info, but not the startup type. For that you will need to get the Handle[^] for the service to monitor and get the startup type yourself using QueryServiceConfig[^].
pinvoke.net has signature for it[^] (see the sample at the bottom).
Be sure to Dispose/Close the handle when you are done with it. It will be cleaned up automatically, but it's better to do it yourself.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
i have a class that extends the window UIElement
class MyWindow : window{
..yada yada...
}
inside MyWindow, i use a DockPanel to Dock an instance of MyGrid:
class MyGrid : Grid{
.. yada yada ...
}
inside the grid i dynamically create a bunch of TextBox()'es that gets and sets some values of an object.
MyWindow has some overrides of KeyUp and KeyDown events that i manage, for instance i campture when CTRL-keys are pressed and other stuff
my problem is that if i change a value in one of the TextBox'es, then MyWindow looses Focus (i think) -- the KeyUp and Down events are nomore being captured
one thing which is important, is that i have a Blur() method on MyGrid that removes the TextBox'es and other stuff whenever an object is de-selected from MyWindow
MyGrid.Blur(){
ColumnDefinitions.Clear();
RowDefinitions.Clear();
Children.Clear();
}
this method causes the docked grid to disapear, but the keyboard is still writing to the last (now not existing) TextBox()
What to do ???
|
|
|
|
|
Hi,
i have values in one from and i have use same values in other forms how to pass this values
kirankumar
|
|
|
|
|
This question gets asked all the time, despite the number of times that it's been answered. You use delegates to pass data between forms
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
i want capture the value of the column?how to capture?
kirankumar
|
|
|
|
|
You can access it directly.
myGrid.Rows[0].Cells[0]
for example.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Actually my data is in xml format that data i binded to datagridview and in first column i taken one button and second,third,forth columns data is that xml data.second,third,forth columns are firstname,lastname,address whenever i click the button of first column i want to capture the firstname, secondname and address .
kirankumar
|
|
|
|
|
this is the code i tryed in webapplication but its not working in windows forms it shows some error near that Findcontrol
string candidateID_Label = ((Label)candidate_Approval.Rows[e.RowIndex].Cells[0].FindControl("candidateID_Label")).Text;
kirankumar
|
|
|
|
|
'some error' ? Does the label of that name exist in your form ? You shouldn't have to use this in a forms app.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Is it possible to use a WebBrowser control to open an existing web page and populate the text controls on the web page from VB.NET code? NOTE: the web page could be any existing page. For example www.google.com. Browse to Google and put some search text into the text control and press the Search button.
mcnewsxp
mcnewsxp
|
|
|
|
|
I use this[^] tutorial in socket programming. I could build and execute it without problem.
But now I want to add it to my windows form, so my windows form can communicate. I got a bunch of errors when I add the files into my projects.
Any advice?
Thanks in advance.
----------
C++ Learner
|
|
|
|
|
You're adding a native C++ class to a .NET project? Are you using C++/CLI? What are the errors you are getting?
|
|
|
|
|
Hi all,
Can u pls tell me how to mount any disk mage file to any folder.
How we can mount any file?pls tell me it is highly obliged me.
Thanks in Advance
Bhaskar
|
|
|
|
|
Please don't cross post.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
my question is thus:
i created a master detail entry form, i have to insert the master record before the detail record.
the issue is the master does not insert
here is the code:
private bool Save()<br />
{<br />
bool saved = false;<br />
<br />
Validate();<br />
fACTORY_PURCHASEBindingSource.EndEdit();<br />
fACTORY_ITEMSBindingSource.EndEdit();<br />
<br />
FactoryDataSet.FACTORY_PURCHASEDataTable newInvoice =<br />
(FactoryDataSet.FACTORY_PURCHASEDataTable)<br />
factoryDataSet.FACTORY_PURCHASE.GetChanges(DataRowState.Added);<br />
FactoryDataSet.FACTORY_ITEMSDataTable newItems =<br />
(FactoryDataSet.FACTORY_ITEMSDataTable)<br />
factoryDataSet.FACTORY_ITEMS.GetChanges(DataRowState.Added);<br />
<br />
FactoryDataSet.FACTORY_PURCHASEDataTable deleteInvoice =<br />
(FactoryDataSet.FACTORY_PURCHASEDataTable)<br />
factoryDataSet.FACTORY_PURCHASE.GetChanges(DataRowState.Deleted);<br />
FactoryDataSet.FACTORY_ITEMSDataTable deleteItems =<br />
(FactoryDataSet.FACTORY_ITEMSDataTable) factoryDataSet.FACTORY_ITEMS.GetChanges(DataRowState.Deleted);<br />
<br />
try<br />
{<br />
if (newInvoice != null || newItems != null)<br />
{<br />
fACTORY_PURCHASETableAdapter.Update(newInvoice);<br />
fACTORY_ITEMSTableAdapter.Update(newItems);<br />
}<br />
<br />
if(deleteInvoice != null || deleteItems != null)<br />
{<br />
fACTORY_ITEMSTableAdapter.Update(deleteItems);<br />
fACTORY_PURCHASETableAdapter.Update(deleteInvoice);<br />
}<br />
<br />
factoryDataSet.AcceptChanges();<br />
saved = true;<br />
<br />
}<br />
catch (Exception ex)<br />
{<br />
MessageBox.Show(ex.Message);<br />
}<br />
<br />
return saved;<br />
}
|
|
|
|
|
Hi All,
I'm having trouble docking a window which should automatically fixed to the top, right and left edges of a one half of a SplitContainer when it opens. The child window should open when I click an option from a TreeView that I'm having in the other part of the SplitContainer. Thanx in advance.
Era
|
|
|
|
|
erarocks wrote: I'm having trouble docking a window
What exactly is the trouble?
|
|
|
|
|
You do not very clearly describe exactly what it is that you are trying to do.
If I read this correctly then it appears that what you are doing is this:
left side has a treeview with items in it.
when you click on a value in the treeview you populate the other side with a control that is populated with the data related to the value chosen in the treeview.
I also am guessing that the problem is that the user control doesn't dock in the other side of the SplitContainer.
It is up to YOU to do that. Do the same thing programmatically that you would do in the designer.
1) put control into container
2) tell the control how you want it docked.
... era does not rock if era cannot clearly explain his problem.
|
|
|
|
|
I have a small invoicing application in MS Access that I have started converting to SQL Server 2005 and WinForms. This is a very small application, and I should have full functionality in two or three days, with all bells and whistles by the end of next weekend.
I'm in two minds whether to sweat it out and implement databinding, or just do what I know best and code all my own data access, using DataTable objects as 'proxies' for detail grids etc. All I know about data binding is the problems I've had previously when changing column names etc. Visual Studio 2005 seems to remember things you want forgotten in very secret places.
However, this is a great opportunity for me to overcome my lack of experience and learn to deal with the problems I have encountered before. What is the general opinion on this? At least I now have internet at home, so my friend Google will be looking over my shoulder when I attempt a data bound application.
BTW, I am also moving forward in learning NHibernate, but I feel the overhead of learning something at that level, outside of the intrinsic .NET tools, is a little too much for a project of this size.
Calling all South African developers! Your participation in this local dev community will be mutually beneficial, to you and us.
|
|
|
|