Dynamic items to ContextMenuStrip and Text from sub-items?
How to add dynamically new item WITH subitems to ContextMenuStrip?
I already have designer edited ContextMenuStrip on the form but I need
to add some items with sub-items to it dynamically on runtime. How to
do that?
I can add normal items with
myMenu.Items.Add("My new item");
But I have no idea how to add Item with sub-items.
Other question is, how can I get "Text" from sub-items and those new
dynamically created sub-items? I know I can do
Point p = myMenu.PointToClient(new Point(Form.MousePosition.X,
Form.MousePosition.Y));
ToolStripItem pItem = myMenu.GetItemAt(p.X, p.Y);
this.Text = pItem.Text;
But it only give text from main items, not from sub-items.
Any ideas are apreciated, thank you. Tag: ToolStripMenuItem Child or Parent Tag: 101838
IronPython & Windows Forms
Hello all,
IronPython [
http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython ] is a
great dynamic language for the .NET platform (and also works well on
Mono).
As well as being a great language, Python brings rapid application
development to .NET, without losing the power of the breadth of the
.NET API.
As an example of how easy it is to develop with IronPython, I am
writing a tutorial series on using Windows Forms from IronPython.
So far there are five entries :
* Introduction -
http://www.voidspace.org.uk/python/weblog/arch_d7_2006_05_20.shtml#e342
* Hello World -
http://www.voidspace.org.uk/python/weblog/arch_d7_2006_05_20.shtml#e343
* Widgets & Event Handlers -
http://www.voidspace.org.uk/python/weblog/arch_d7_2006_05_27.shtml#e344
* Panels & Styles -
http://www.voidspace.org.uk/python/weblog/arch_d7_2006_06_03.shtml#e351
* The Textbox Widget -
http://www.voidspace.org.uk/python/weblog/arch_d7_2006_06_03.shtml#e352
The series is still in it's early days. Comments and corrections
appreciated.
All the best,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml Tag: ToolStripMenuItem Child or Parent Tag: 101837
Language detection
Hi there. I need to detect what languages are supported by an application
using the VS automation IDE (for a VS add-in). Unfortunately, I can't seem
to find any clean way of doing this other than searching for all (embedded)
resource files and checking for the appropriate language extension (e.g.,
"MyResource.[<LanguageExtension>].resx"). Does anyone know if there's a
cleaner way of doing this (none that I can find in the automation API so
far) and more importantly, how do you determine what the default language is
(since no language extension is present for default language resource
files). Thanks in advance. Tag: ToolStripMenuItem Child or Parent Tag: 101836
NetworkChange does not work
http://msdn2.microsoft.com/en-us/library/system.net.networkinformation.networkchange.aspx
I am trying the vb.net example from above link. But it does not work for
me.
Does it atall works. Is it working for anybody.
I am using framework 2.0, Windowx XP
Steve. Tag: ToolStripMenuItem Child or Parent Tag: 101834
Visual styles an .NET Framework 2.0
In .NET Framework 1.1 in order to enable visual styles we had to code:
Application.EnableVisualStyles();
Application.DoEvents();
before anything visual, and then set the FlatStyle attribute of the controls
to FlatStyle.System.
Is all these needed on version 2.0 in order to achieve the same behaviour
(XP like controls) ?
Thanks
Emmanuel Tag: ToolStripMenuItem Child or Parent Tag: 101824
Sharing a component across multiple tabs
Hi,
I have an application where multiple TabPages (within the same
TabControl) need to contain the same components; switching tabs changes
the data source feeding into the components. I guess this is a problem
a lot of people have solved in the past, but I can't seem to get it to
work elegantly.
In my current implementation, each time I receive a "Selected" event
from the TabControl I switch over my data source, then add my data
panel to the newly-selected tab (which automatically removes it from
the previous tab). This works reasonably well, but the data grid
"flickers" irritatingly - I suspect because of the reparenting.
I have tried making the TabControl and the data panel children of the
same parent Panel, laid out so that the tabs abut the data panel, and
simply changing the data source when the tabs change. This avoids the
flickering problem - but unfortunately the 3D border of the TabPanel is
very visible, so it's obvious that the data panel is not on the
TabControl. If I could switch off the 3D border, this could look OK,
but I can't find any way to do that.
My final attempt was again to put the TabControl and the data panel on
the same parent Panel, but this time making sure that the data panel
was on top of the TabControl in the Z-order, and then listening for
Resize events from the TabControl and handling them by resizing the
data panel so that it precisely obscures the TabPanel. This *almost*
works, but (a) the resizing happens a bit too slowly, and is very
visible to the user, and (b) it feels really really hacky :-)
There *must* be a better way of doing this, can anyone help me out?
Cheers,
Giles Tag: ToolStripMenuItem Child or Parent Tag: 101818
Using the ASP.NET 2.0 Profile in WinForms
Hi all,
We have an ASP.NET 2.0 web app which uses Profiles, and want to write a
little WinForms app to administer sections of the site.
In a little prototype, I was able to utilize Profile in the WinForms
app! I added this to my app.config:
<system.web>
<profile>
<properties>
<add name="FirstName" type="string" />
<add name="LastName" type="string" />
</properties>
</profile>
</system.web>
(So, it's using the default SQLExpress database/provider).
I then wrote this code in a form to create and save profile info:
Dim p As ProfileBase = ProfileBase.Create(txtUsername.Text)
p("FirstName") = txtFName.Text
p("LastName") = txtLName.Text
p.Save()
NOW, I do have one remaining question. When using Profile in ASP.NET,
ASP.NET somehow creates a "ProfileCommon" subclass of ProfileBase with
strongly-typed properties (as opposed to the non-strongly-typed
properties that I use above). Each Page's "Profile" property returns
this ProfileCommon.
How does ASP.NET create this ProfileCommon class - does it
code-generate it? Secondly, is there a way that I could make use of
the strongly-typed ProfileCommon class in my WinForms app? Tag: ToolStripMenuItem Child or Parent Tag: 101817
Toolbar in a TaskBar like Windows Media player
I am trying to put a toolbar in the taskbar when the user minimizes the
application, something like windows media player where when you minimize it
puts the toolbar on the taskbar and you will be able to do some basic
operations on media player or bring back the window etc.
I would really appreciate any suggestions or pointers how to do this.
Thanks in Advance Tag: ToolStripMenuItem Child or Parent Tag: 101816
Dock and Z-Order Problems
I have a lingering problem with control docking and z-order.
As I understand it, the control docking order based on the control z-order.
So If I have two controls, Control1 & Control2 whose Dock properties are both
set to Top, the control that is "Top Most" will appear on the top. I tried
changing
the z-order in the designer for Control2 by selecting bring to front, but
when I show
the form, Control1 appear on top.
Programatically, I tried settting the z-order by calling the BringToFront
method
and then changing the Dock as follows:
Control1.Dock = DockStyle.None;
Control2.Dock = DockStyle.None;
Control1.Location = new point (0,0);
Control2.Location = new point (0,0);
Control2.BringToFront();
Control1.Dock = DockStyle.Top;
Control2.Dock = DockStyle.Top;
But this still does not work. How do I set Control2 to be on Top of the form?
I hope I don't have to muck around with the designer generated code.
I am using .Net 2.0.
Thanks Tag: ToolStripMenuItem Child or Parent Tag: 101813
MDI form and MessageBox
I have an MDI form with Child forms.
If I show a MessageBox from an MDIChild form and click any of the buttons on
the MessageBox my MDI Parent (and it's children) dissappear behind any other
windows I might happen to have open at the time.
Any Ideas? Tag: ToolStripMenuItem Child or Parent Tag: 101812
TreeView TreeNode LabelEdit accepts only one character C++ VS2005
The following MDI Form only allows me to type one character in the
TreeNode's edit control unless the child window is focused in a Normal
(or Maximized) WindowState.
After entering one character the child form is appears to receive
focus, ending the edit operation. If there is more than one MDI child,
then the first child receives focus and is brought to front.
How can I fix this?
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
}
protected:
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::TreeView^ treeView1;
private: System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->treeView1 = (gcnew
System::Windows::Forms::TreeView());
this->SuspendLayout();
//
// treeView1
//
this->treeView1->Dock =
System::Windows::Forms::DockStyle::Left;
this->treeView1->LabelEdit = true;
this->treeView1->Location = System::Drawing::Point(0, 0);
this->treeView1->Name = L"treeView1";
this->treeView1->Size = System::Drawing::Size(200, 471);
this->treeView1->TabIndex = 0;
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode =
System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(696, 471);
this->Controls->Add(this->treeView1);
this->IsMdiContainer = true;
this->Name = L"Form1";
this->Text = L"Form1";
this->Load += gcnew System::EventHandler(this,
&Form1::Form1_Load);
this->ResumeLayout(false);
}
#pragma endregion
private:
System::Void Form1_Load(System::Object^ sender,
System::EventArgs^ e)
{
Form^ f = gcnew Form();
f->MdiParent = this;
f->Show();
f->WindowState = FormWindowState::Minimized;
TreeNode^ tn = this->treeView1->Nodes->Add("Top1");
tn->Nodes->Add("sub1");
tn->Nodes->Add("sub2");
tn = this->treeView1->Nodes->Add("Top2");
tn->Nodes->Add("sub3");
tn->Nodes->Add("sub4");
tn->Nodes->Add("sub5");
tn = this->treeView1->Nodes->Add("Top3");
tn->Nodes->Add("sub6");
tn->Nodes->Add("sub7");
tn->Nodes->Add("sub8");
this->treeView1->ExpandAll();
}
}; Tag: ToolStripMenuItem Child or Parent Tag: 101811
Collapsable Panel
Is there a control in 2.0 that can be used as a collapsible panel? Or do I
need to look at implementing my own or using a 3rd party control?
Thanks
Brian Tag: ToolStripMenuItem Child or Parent Tag: 101804
New controls in .Net 2.0
Is there something online somewhere that demos all or most of the new
controls in 2.0? I've searched google and MSDN to no avail.
Thanks,
Brian Tag: ToolStripMenuItem Child or Parent Tag: 101803
With DataDirectory Keyword: CrystalReports.Load, CrystalReports.SetDataSource Yields Password Prompt Which You Can Cancell And Still See Report! How To Stop Prompt
Hello, the step that I did to get to my current question are:
I began to use the keyword DataDirectory and the next line of code.
When I ran the application, I would be asked for a Login ID and
password. If I clicked the cancell button on that Login window I would
not see the report at all.
CrystalReport1.Load(Application.StartupPath &
"\..\..\CrystalReport1.rpt")
So, I eventually tried the following 2 line code sequece. This time
if I pressed the cancell button on the Login window it would show the
report.
CrystalReport1.Load(Application.StartupPath &
"\..\..\CrystalReport1.rpt")
CrystalReport1.SetDataSource(Employee_DatabaseDataSet)
Question: The last 2 lines of code will display the report and I'm
pleased with that. But, how can I stop the Login prompt? I want to just
open the report without being asked for Login ID or password.
Trying to finish-up a project,
Christopher Lusardi Tag: ToolStripMenuItem Child or Parent Tag: 101799
Cann't Hide Main Form Window
Hi ,All
I have a small c# app, when It start, Hide it self to system tray.
but when I add:
public Form1()
{
InitializeComponent();
Hide();
}
or
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Hide();
}
they doesn't work,
How can I do ?,
thanks
--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/
_/ Nie Longhai , coder -_-|||
_/ Shanghai Xomi Instruments Co., Ltd.
_/ URL: http://www.xomi.cn
_/ Shanghai C&U Industrial Park
_/ Feng Cheng Town, Feng Xian District
_/ Shanghai, 201411
_/ Phone:86-21-57513966-807
_/ Fax:86-21-57513636
_/ Mobile:13162055440
_/ Email:NieLH@xomi.cn ,cok119@163.com
_/
_/ Profession & Focus
_/ High precision semiconductor metrology system vendor.
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ Tag: ToolStripMenuItem Child or Parent Tag: 101796
XSD File and Database View
hi Guys!
i've faced very very strange problem. i don't know whether it is a
problem or its the feature of the .net 2.0. I'd made some Dataset using
XSD file. in this XSD files i've created 3 tables and defined some
constraint in them. i generated Data Adapter and everything was working
fine. Then i made change in the database. i added one column in the one
of the table and renamed the table and also created the view with the
previous name of the table so that my dataset work correctly. but what
surprised me is, my dataset didnt work. yeah, i spent hours to find out
the problem but all my R&D failed.
after lots of R&D i drop the view and again renamed the table and
everything started working back. and that surprised me.
My conclusion on this is :
-- if you have enforced constriant in the Dataset XSD files, then do
remember to modifiy tables in the file as you modify them in the
database
-- XSD file doesnt work with views. i mean if you have constraint
enabled then XSD failes to work with view as it only requires physical
tables so that constraint can be enfored.
I want your vies on my experienced because this is something i cant
find it anywhere and only experienced developers can tell me why, what
and how on this problem. please let me know if there is something i'm
missing.
thanks,
Lucky Tag: ToolStripMenuItem Child or Parent Tag: 101794
Minus key on numpad not in Keys enumeration?
Hello Group,
i want to know how to handle the pressed key on the numpad? I found
Keys.OemMinus but this does only follow the pressed "normal" minus key
and not the minus key on the numpad.
There is Keys.Add for the plus key on the numpad and Keys.Oemplus for
the "normal" plus key.
Please help me - thanks.
Roland Tag: ToolStripMenuItem Child or Parent Tag: 101786
Clipboard and custom data
hi,
there's some very strange with the clipboard (I'm using .NET 2.0). I
tried to set an object (type is inherited from TreeNode) to the
clipboard. This works fine but when I want to retrieve this object from
clipboard it doesn't work. It's strange because the GetDataPresent
methode returns "true" when I ask wether the requested type of object
is present at the clipboard. However getting the object returns "null".
Here's some code of my app:
// copy to clipboard
TreeNodeEx copy = (TreeNodeEx)treeCards.SelectedNode.Clone();
DataObject data = new DataObject();
data.SetData("Test", copy);
Clipboard.SetDataObject(data);
// paste from clipboard
TreeNodeEx t = Clipboard.GetDataObject().GetData("Test") as TreeNodeEx;
// type of the object
[Serializable]
class TreeNodeEx : TreeNode
{
[...]
}
Why doesn't this work?
Thanks for any help
Steffen Tag: ToolStripMenuItem Child or Parent Tag: 101784
Buttonrendering, datagrid
Hi all,
When a cell of a datagrid is set to type combobox, it doesnt show the little
dropdown button until the actual cell is clicked. I want the cell to have
the button all the time, also when not clicked. As far as i know, the only
way to do this is to draw your own little button in the cell by using the
rendering.. this works fine, however i have drawn a normal button now, i
want an exact copy of a "combobox-button". Does anyone have any idea how to
accomplish this? The normal button i get using following code.. It is gray,
which should be lightblue and i use a "v" to show on the button, which isnt
ideal either..
Many thanks for any suggestions.
Albert
Dim clickrectangleValue As New Rectangle
With clickrectangleValue
.X = e.Bounds.X + (0.75 * e.Bounds.Width)
.Y = e.Bounds.Top + (0.05 * e.Bounds.Height)
.Width = e.Bounds.Width * 0.25
.Height = e.Bounds.Height * 0.9
End With
ButtonRenderer.DrawButton(e.Graphics, clickrectangleValue, "v", Me.Font,
False, state) Tag: ToolStripMenuItem Child or Parent Tag: 101783
Uninstaller Help
Hi everyone, is it posible to assing a custom uninstaller to your
application?.. i mean.. that if you choose to uninstall your software
in control panel's add/remove programs, that uninstaller that you did
will execute? Tag: ToolStripMenuItem Child or Parent Tag: 101778
About MultiThread in Form
Hi ,All
I'm a newbie for c#, I have a question about MultiThread in C# and Form,
In .Net 2.0, the Form cann't be access by other thread, but
when I start a new thread using follow code:
Thread newThread = new Thread(MyFormInstance.method)
compile and run OK,
why this Form instance can be access by two thread(main thread and
newThread)
and no exception occured?
thanks for any advice
--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/
_/ Nie Longhai , coder -_-|||
_/ Shanghai Xomi Instruments Co., Ltd.
_/ URL: http://www.xomi.cn
_/ Shanghai C&U Industrial Park
_/ Feng Cheng Town, Feng Xian District
_/ Shanghai, 201411
_/ Phone:86-21-57513966-807
_/ Fax:86-21-57513636
_/ Mobile:13162055440
_/ Email:NieLH@xomi.cn ,cok119@163.com
_/
_/ Profession & Focus
_/ High precision semiconductor metrology system vendor.
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ Tag: ToolStripMenuItem Child or Parent Tag: 101776
Performance issue due to Background image
I have my base form which has background image , tool bar etc,All other
forms inherit it. The background image size is 34kb and it is in Jpeg
format.All the other forms also has many images since we have unique look and
feel. The issue I am facing is performance .
Application works fast when I don't have background image on my base form (
in turn we don't have any background image for any of the form), But when I
apply background image for the base form or individual form , screen loads
slowly ie.. the controls on the screen loads slowly .
is there any way to overcome this problem
Technology - Windows form in VB.Net Tag: ToolStripMenuItem Child or Parent Tag: 101769
clickonce async wait
I want to do an async update with clickonce.
The main reason is so I can get the
DeploymentProgressChangedEventArgs (bytes downloaded etc.)
and update the UI.
What is the best way to wait in the main thread until the
CheckForUpdateCompleted event fires.
thanks, Tag: ToolStripMenuItem Child or Parent Tag: 101768
Professional Toolstrip Renderer
Is there a simple method to set the renderer to one of the three standard XP
themes without having to set each property?
I want to give the user the option (on pre XP systems) to set the
application style to one of the XP themes.
Thanks. Tag: ToolStripMenuItem Child or Parent Tag: 101767
Windows Form Application Authentication in .NET 2.0
Hi,
I am trying to implement ActiveDirectory Authentication for Windows
Form Application in .NET 2.0. I am not getting much help regarding
WinForms with ActiveDirectory, but most of the information telling
about ASP.NET with Active Directory.
Can any one please point me to the right information.
Thank you!
Suresh Tag: ToolStripMenuItem Child or Parent Tag: 101765
Drag and Drop Outlook attachment into a Windows Form Control
I previously performed drag and drop between 2 lists within a Windows form.
Right now I am looking for something a little more complex and I am not able
to find a way to do it.
In just few words, I want to drag a file (in my case a PDF file) which is an
attachment to an email in Outlook 2003 client and drop it over a control (in
my case a command button or anything else) within a window in my application.
When file is dropped over my designated control, I do not need to open it I
just want to save it into a SQL database. Saving files in SQL databases is
not an issue because I am already doing it, my only problem is I don't know
how to capture the dropped file into a variable in order to be afterwards
able to save it into the database.
The same question would apply for other formats too (e.g. BMP, JPG, TIFF,
DOC, XLS, etc.) if each type should be handled in a different way.
I appreciate any hints into this issue.
Thanks,
Adrian Tag: ToolStripMenuItem Child or Parent Tag: 101764
Using vbTab to create tsv files
I'm attempting to create a tsv file (i.e. equivalent to what Excel produces
when you use the Text (tab delimited) type when saving. I'm trying this...
Dim sw As New System.IO.StreamWriter("c:\test.tsv")
sw.Write("sdfdsf" + vbTab + "dsfsd")
sw.Close()
...but the output of that is gibberish. Anyone how to do this? Tag: ToolStripMenuItem Child or Parent Tag: 101758
Data binding to a NUmbericUpDownBox
I have 1 row of data in data set and want to bind to a numeric box. I
figured that nUpDwnMin1.DataBindings.Add("Value", ,"Min_1"); but I
having an issue figuring out the source notation.
Unfortunately, I am getting confused about setting the value from the
data set. I created all my tables with table[0].
Do I have to use a get and set statement for the valuesl in the class?
Can I directly load from the dataset? Also, these are numbers that
will be updated that's why I decided to use a dataset to write back
easily? This data set only contains 1 record. I put the code below to
see if I am going over board.
Any help is greatly appreciated.
Mark
//Call over
private void Load_CodeAssignments()
{
DataTable dt = new DataTable();
Codes dsCodes = new Codes(cbDept.Text, cbPyramid.Text);
dt = dsCodes.Get_Codes;
//nUpDwnCodeA.Value = dsCodes.Get_Codes.Columns["A_pct"]; No good
//nUpDwnMin1.Value = Convert.ToDecimal(dt.Columns["Min1"]); No good
nUpDwnMin1.DataBindings.Add("Value", ,"Min_1");
}
//Class
public class Codes
{
#region Private Members
private DataSet _dsCodes;
#endregion
#region Public Properties
public DataTable Get_Codes
{
get { return _dsCodes.Tables[0]; }
}
#endregion
#region Constructors
public Codes(string Department, string Pyramid)
{
//This will establish the database connection
Database db = DatabaseFactory.CreateDatabase("Test");
//This will allow you to call a SP and use parameters
DBCommandWrapper dbc =
db.GetStoredProcCommandWrapper("usp_Inv_SS_GetCodes");
dbc.AddInParameter("@Department", DbType.String, Department);
dbc.AddInParameter("@Pyramid", DbType.String, Pyramid);
_dsCodes = db.ExecuteDataSet(dbc);
}
#endregion Tag: ToolStripMenuItem Child or Parent Tag: 101753
treeview
I have a treeview wist several nodes
each node has its own context menu
for now, every menuitem in theese menues has the same code:
msgbox (treeview1.selectednode.name.tostring,okonly)
the problem is that every i click on the menuitem the message box shows
me name of the node that was selected before rightclick and thet node
is stil selected.
how do i get node name of the node where right click happened? Tag: ToolStripMenuItem Child or Parent Tag: 101746
Program stuck when removing row from DataTable
Hello
I have built a DataGridView that its data source is binded to a DataTable
after adding it 200 rows I try to remove the first row and the program
stuck, What could it be????
Thanks. Tag: ToolStripMenuItem Child or Parent Tag: 101740
ClickOnce error
After a few problems with my windows account (was deleted and then made it
again with the same name) I can't update my app with ClickOnce.
The error is
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later
in the log.
* Activation of C:\Documents and Settings\john\Start
menu\Programs\john\contacts.appref-ms resulted in exception. Following
failure messages were detected:
+ The referenced assembly is not installed on your system. (Exception from
HRESULT: 0x800736B3)
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [08.06.2006 11:07:55] : Activation of C:\Documents and
Settings\john\Start menu\Programs\john\contacts.appref-ms has started.
ERROR DETAILS
Following errors were detected during this operation.
* [08.06.2006 11:07:55] System.Runtime.InteropServices.COMException
- The referenced assembly is not installed on your system. (Exception from
HRESULT: 0x800736B3)
- Source: System.Deployment
- Stack trace:
at
System.Deployment.Internal.Isolation.IStore.GetAssemblyInformation(UInt32
Flags, IDefinitionIdentity DefinitionIdentity, Guid& riid)
at System.Deployment.Internal.Isolation.Store.GetAssemblyManifest(UInt32
Flags, IDefinitionIdentity DefinitionIdentity)
at
System.Deployment.Application.ComponentStore.GetSubscriptionStateInternal(DefinitionIdentity
subId)
at
System.Deployment.Application.SubscriptionStore.GetSubscriptionStateInternal(SubscriptionState
subState)
at
System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String
shortcutFile, TempFile& deployFile)
at
System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri
activationUri, Boolean isShortcut)
at
System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object
state)
What assembly is about and how can I correct this ? Tag: ToolStripMenuItem Child or Parent Tag: 101732
How to place border to the item selected in the listbox?
Hi All,
I'am using Vb.net 2005.I want to develop an application in which I have
listbox control with 2 columns in it. In first column string is
displayed and in other column colored labels are displayed. Now
whenever i select item from a listbox it shows blue color filled into
that row. Instead of this i want whenever user selects item from
listbox some rectangular border is placed thorugh the item.
For a look it is there in Microsoft publisher color scheme.
Please let me know how to do it.
Thank You in advance.
-Manju Tag: ToolStripMenuItem Child or Parent Tag: 101731
How to place border to the item selected in the listbox?
Hi All,
I'am using Vb.net 2005.I want to develop an application in which I have
listbox control with 2 columns in it. In first column string is
displayed and in other column colored labels are displayed. Now
whenever i select item from a listbox it shows blue color filled into
that row. Instead of this i want whenever user selects item from
listbox some rectangular border is placed thorugh the item.
For a look it is there in Microsoft publisher color scheme.
Please let me know how to do it.
Thank You in advance.
-Manju Tag: ToolStripMenuItem Child or Parent Tag: 101730
How to place border to the item selected in the listbox?
Hi All,
I'am using Vb.net 2005.I want to develop an application in which I have
listbox control with 2 columns in it. In first column string is
displayed and in other column colored labels are displayed. Now
whenever i select item from a listbox it shows blue color filled into
that row. Instead of this i want whenever user selects item from
listbox some rectangular border is placed thorugh the item.
For a look it is there in Microsoft publisher color scheme.
Please let me know how to do it.
Thank You in advance.
-Manju Tag: ToolStripMenuItem Child or Parent Tag: 101729
.net framework configuration
Hi everyone,
I have to install a .net executable on every machine in my network. Done.
Now, when this executable runs, it stops with an unhandled exception. The
only machine where it runs OK is the one on which I put up a .net framework
security policy that enables the application to run. Right, but is there a
way to set up this configuration via script or group policy, or do I have to
manually configure each workstation ?! Tag: ToolStripMenuItem Child or Parent Tag: 101728
PropertyGrid MS .Net gurus opinion needed
Hi there all,
I've used the property grid control in the past and it is a very nice
control.
But i wonder is there a way to switch the left and right columns, for
languages the use RTL the left column should be the value column and
the right column should be the property name column.
Is there a way to achive this without writing the control from scratch
?
I've explored all of the properties and methods of the property grid
and didn't found a hack for this.
0L Tag: ToolStripMenuItem Child or Parent Tag: 101727
"Global" objects
I am new to .NET and am wondering how to accomplish having certain
global objects that could be referenced by other forms/user controls. I
have a main form on which I show various user controls depending on
which item the user clicks on in the NavBar on the left of the form.
Each user control has certain program functionality on it. What I want
to do, for example, is have certain object variables on the main form
(e.g. m_oEventLogger) that I can reference from my user controls, or
from other forms that I might show.
1) How do I declare these in the code for the Main form?
2) How would I refer to them from user controls shown on the main form?
3) How would I refer to them from other forms that are shown separate
from the main form? Tag: ToolStripMenuItem Child or Parent Tag: 101726
What is major difference between form and usercontrol?
Both of them are derived from Container Control Class.
But if I used a user control derived class, it cause a refreshment
problem, whereas everything was okay if used a form derived class.
I suspected user control had blocked some messages.
thx. Tag: ToolStripMenuItem Child or Parent Tag: 101723
Problem with MDI child form behavior
I'm working on a C# program in Visual Studio 2003. The main form has a
treeview control on the left side, a splitter, and the right side of the
splitter has nothing and is used as the MDI client area. I have several MDI
child forms open (typically maximized) and can pick which child form has
focus by clicking on it's node representation in the treeview control. The
event handler for the treeview figures out which mdi child form is associated
with the selected node and does Child.Focus().
Everything works fine, except one of my forms. It is fairly long, has
AutoScroll = true, and has a vertical scrollbar even when maximized, because
of the length of the form. The form will look normal the first couple of
times I choose it's node (is maximized with a scrollbar). But eventually when
I select another form, then switch back to this form it will be resized as if
the windowstate is "Normal", even though it is actually "Maximized". The
middle controlbox button shows as if the form is maximized and I can see the
other child form maximized behind it.
If I click the "maximize" controlbox button, it will stay it's same size,
but switch to "Normal" windowstate, where I can click the "maximize" button
again to maximize it to the proper view. Also, if I've switched to this child
form so that it is in this messed up state and just start to resize the main
parent form, the mdi child form will immediately snap into the proper
maximize state. If I turn "AutoScroll" off, the child form won't ever go into
this weird state, but I don't have the scrollbar, which is needed.
This seems like a bug with the .NET framework that others might have come
across. Does anyone know what's happening or a solution? Tag: ToolStripMenuItem Child or Parent Tag: 101717
.NET windows service does not autostart
I have created a windows service in VS2005 .NET, which works well. The
service is set to "Automatic", however it does not autostart on bootup. The
eventlog shows the error "The service did not respond to the start or control
request in a timely fashion"
My service uses TCP/IP sockets, so I have specified "Tcpip" as a dependency
service (For some reason, the DependOnService shows up in the registry entry
for my service, but not in the services management MMC). My service also
tries to connect to a SQL server on a remote database at startup (I am using
ADO.NET).
Should I be adding any other DependOnServices?
I read a post about this error happening if the Application event log is
full, however, on my machine it is set to "overwrite events as needed", so I
dont think thats the issue.
Harv Hundal Tag: ToolStripMenuItem Child or Parent Tag: 101716
Is there a way to stop control events during the form load?
I have a VB.NET app with a radio button that has check changed handler on
it, and the InitializeComponent() code sets the .checked value to true which
triggers the event handler. Is there a way to suspend event processing
until initialization is complete?
Thanks. Tag: ToolStripMenuItem Child or Parent Tag: 101714
ClickOnce Double Install Prompt
I am trying to deploy an application using ClickOnce
The website appears to be correct. The user can open it in thier browser and
click on the install button
The user receives the Application Install - Security Warning prompt and can
click Install or Dont Install
The user clicks Install
The app appears to be installing
The user then receives a second Application Install - Security Warning
prompt and can click Install or Dont Install
If the user clicks Dont Install then a security exception happens
('System.Security.Policy.PolicyException')
The Start Menu Icon was created
The user can then click on the Start Menu Icon
The user receives the Application Install - Security Warning prompt and can
click Install or Dont Install
If the User Click Install the application will then run
The user will then never be propmted again.
How can I remove the second Install prompt?
Thank you Tag: ToolStripMenuItem Child or Parent Tag: 101713
Active Directory Authentication in .NET2.0
Hi,
I am trying to write Windows Form application in .NET 2.0, which
needs ActiveDirectory Authentication module integration. Can any one
point me to related links. Please suggest me what is the right way of
doing in .NET 2.0.
Thanks
Suresh Eddala Tag: ToolStripMenuItem Child or Parent Tag: 101712
TreeView missing QueryContinue..Event
I am trying to get a QueryContinueDragEvent per the MSDN tutorial on
Drag&Drop from a TreeView control.
My TreeView is at the same time source and destination (basically I am
trying to manually rearrange nodes). I try to abort the D&D when outside the
main form but I can not get the Query.. Event to fire; any ideas what's can
be wrong?
I've already installed handlers/subscribes for most (Ithink) related events
but no luck so far...
Thanks ahead!
TB Tag: ToolStripMenuItem Child or Parent Tag: 101711
ContextMenuStrip on Dual-Screen-Desktop
Hi,
when the ContextMenuStrip is opened near the right margin of the first
screen, the menu itself is displayed on the second screen. Windows
Explorer shows it's context menu left of the mouse-cursor-position when
opened at the same screen-position.
Is there a way to change the behaviour of opening ContextMenuStrip to
the behaviour of the contextmenus in Windows Explorer?
Thanks,
Bruno Tag: ToolStripMenuItem Child or Parent Tag: 101708
Suggestions on this problem? (List of controls / user controls)
Hi,
I have a problem where i need to show non-standardised information in a list
and would like to provide in place editing if possible.
for example
Line 1 A B C
Desc 1 3 5 6
Line 2 I II III IV
Desc 2 2 4 5 5
The numbers under thier respective headers are the ones i need to provide
in-place editing for.
There should never be 100s of lines/items so i'm not too worried about
creating lots of window handles cos there shouldn't be too many.
However, should I...
a) use an owner drawn list / control and provide editing in a custom control
shown from a Dialog window that is opened after user has selected the item
he/she wants to edit? (no inplace editing)
b) create a user control which creates all the fields, labels etc and show
them in a scrollable control? inplace editing ok, but nightmare to code, esp
i'm additing and removing lines
c) use a datagrid, with an owner drawn column? is this possible?
I already have a user control which renders itself and child text boxes etc
for a single item, is there any control anyone knows of that can render a
series of user controls? or how do you create an owner drawn datagrid
column? (if it's possible)
there are a few options i guess, but none seem to be that good. I've seem
some 3rd party DataGrids that allow owner drawn cells but this must be
possible with DataGrid no?
any advice appreciated
--
TIA
Sam Martin Tag: ToolStripMenuItem Child or Parent Tag: 101706
BindingNavigator: does it have a 'Current Item Changed' type of event?
I need to do something extra every time the position of what is the
'current' item changes. This could be the user clicking one of the buttons,
or typing in a new number
However, there doesn't seem to be an event that just says " the user
selected a different item from the navigator". In fact, it seems I have to
handle the Click event of every toolstrip item that could change the
position. Plus, trap the lost focus event for the textbox that displays the
current number, and probably trap its KeyDown event in case the user enters
the new number and hits Enter.
I can't seem to find an event on the navigator itself that would notify me
of when the position changes. Not even a property that says what the
current item index is - I have to parse out what is in the textbox?
I must be missing something basic, because it seems that the control would
be incomplete without these 2 thigns. Tag: ToolStripMenuItem Child or Parent Tag: 101705
Need assistance with DSO
Hi gang, this is pretty critical to me. Any help you can provide is
appreciated.
I have a WebBrowser control placed on a form. I am not getting the same
results as I am in IE.
Here is the deal, I dynamically load the HTML into the WebBrowser control,
then I invoke a script that passes in XML data to the document. The XML
data is not that large, say if it were recipies, it would have maybe 4
recipies in it.
The script that loads our "recipies" first populates the master DSO for safe
keeping. Then it loads the first "recipie" in the the working DSO so that
the user may view it.
What is not working properly is that the data never displays in the
WebBrowser control on the WinForms application, in IE, it works just fine.
I have explored using the onreadystatechange() and ondatasetcomplete()
events in attempt to determine what is going on. I have also traced the
data being sent to the working dso, it just never appears to load the data
in the WebBrowser control.
The WebBrowser control is intended to be a read only view of the data on the
system.
I populate the HTML on the control via the controls DocumentText property
Me.wbViewer.DocumentText = My.Settings.HTMLFile
I then wait for the document to complete loading
Private Sub wbViewer_DocumentCompleted(ByVal sender As Object, ByVal e As
System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles
wbViewer.DocumentCompleted
I then set the data for the document via InvokeScript()
If (Not (wbViewer.Document Is Nothing)) Then
Dim ObjArr(0) As Object
ObjArr(0) = CObj(XmlWrapper.MakeXMLData(<mybusinessobject>))
Me.wbViewer.Document.InvokeScript("loaddata", ObjArr)
End If
Inside the html I have something like:
<!-- Menu Section -->
<div class="left" id="menusection"></div>
<!-- Data Table-->
<table datasrc="#mySelectedData" id="DataTable">
<thead>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</thead>
<tr>
<td><span datafld="Column1"></span></td>
<td><span datafld="Column2"></span></td>
<td><span datafld="Column3"></span></td>
</tr>
</table>
<!-- Error Reporting Textbox -->
<div id="myErrors" />
<xml id="myData"></xml>
<xml id="mySelectedData"></xml>
<script>
function loaddata(data){
try {
myData.XMLDocument.async="false";
myData.XMLDocument.loadXML(data);
reload(0);
}
catch (e) {
myErrors.innerText += "Error loading data: " + e.description;
}
}
function reload(index,settrans){
try {
//Populate transaction table if requested
if (settrans!=0){loadtransactions();}
//hide the data table, just incase the data is empty
DataTable.style.display="none";
DataTable.style.visibility="hidden";
var oNodeList = myData.XMLDocument.selectNodes("rootNode/item");
var oTempNode = null;
var iIndex=-1;
oTempNode = oNodeList.nextNode;
while ( oTempNode != null ){
iIndex ++
if (iIndex == index){
//Load subset of data into working DSO
mySelectedData.XMLDocument.loadXML("<rootNode>" + oTempNode.xml +
"</rootNode>");
//Generate context menus for this set data
genmenus();
//Display the data table
DataTable.style.display="";
DataTable.style.visibility="visible";
//We've gotten what we came for, move on
break;
} //If (iIndex == index)
} //While ( oTempNode != null )
} //try
catch(e){
}
}
//loaddata('<sample><xml><string><here>');
</script> Tag: ToolStripMenuItem Child or Parent Tag: 101693
DataGridView non-focused selection appearance
I have two DataGridViews on a form. (I'm using .NET 2005)
When I run it, I can't tell which control has the focus because the
selection looks the same on both controls.
I'd like the selection appearance to work the way Windows Explorer does
where only one control has the regular blue selection, and the other
controls have a gray selection when they are not selected.
How do I do that?
Thanks! Tag: ToolStripMenuItem Child or Parent Tag: 101685
ListBox: only repaint the items, not other area, in some cases
Sorry I can't clearly describe how to reproduce this problem. Only what
I can confirm is that, in some cases, the listBox just repainted all
items in it, the other area kept the content before.
For example, if another window overlaped on it, after removed that
window, the listBox's items can normally refresh, but the other blank
area kept the content of previous window.
It's very strange. I think listBox does some special things to items
drawing. I don't know how to do.
thx in advance. Tag: ToolStripMenuItem Child or Parent Tag: 101676
Hi all
How can I determine if the ToolStripMenuItem is having child menus ?