Using .NET dll as COM component in MFC MSI Application
Hello,
I have written a class library (dll) using csharp and VS2005.
Now, I want to use this class as COM in my MFC application.
I'm looking for a step-by-step information on how to do it, consiting the
two parts:
1. Exporting a class library as COM component.
2. Using the COM component in my MFC MDI application.
Thanks in advance.
Janiv Ratson. Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103802
message queue
Hi
Here is my problem:
I have a control that does one thing when it is clicked and something else
when it is double clicked. However the click event is always fired before the
double click event. Is there any way I can look at the message queue for this
control and determine if the next message is a double click and therefore
disregard the click event? Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103797
Can you Add a ActiveX control in another thread and show it on a form
I have a third party active X control which I am using. Some
functionalities require a bit of processing (loading and manipulating
files). Since I (or I don't know how to do otherwise) need to add the
control using the same thread as the UI, when it loads the file it
locks up the painting of the form until the control is finished. Is
their a way to have the control loaded in another thread then the form
which holds it?
Thanks Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103796
List of items WinForms can do that WebForms cannot
I would like to build a WinForm demo form (perhaps MDI) to log and
demonstrate the various controls, events, etc that WinForms can do that
WebForms cannot. This is intended as an objective way to compare the
various features, pluses and minuses of each paradigm. I would intend to
post this form to CodeProject for anyone to see. Subsequently, perhaps I or
someone else could do the same for WebForms.
For now, here are a few things I thought of (and I could be in error; that's
the point your help).
1. System tray
2. Notify icon and functionality
3. Popup windows (like Outlook) for new mail arrivals
4. Scroll bars
5. F1 Help
6. MDI
7. Drag/Drop
Thanks,
Dean S Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103795
delay in drawing controls during loading of form
Hi,
I have a form (C#) which has multiple controls on it (picturebox, tab
controls, etc). When the form begins to draw on its initial load, the
background is drawn with all the controls being transparent. Then each
of the controls seem to be drawn one after another. Is it possible to
make it that the form (and all the controls) draws at once. Kinda like
DoubleBuffering if I was doing a OnPaint.
Thanks Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103794
How to unescape HTML string
I have a simple question, is there an easy way in .NET
to unescape HTML characters?
for example I have a string
"Siebel Analytics Sr Consultant-"Partner w/ Deloitte & have
the oppty to become a Partner""
and I want to have
"Siebel Analytics Sr Consultant- Partner w/ Deloitte & have the oppty to
become a Partner"
Thank You Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103791
Language toolbar
Each time I log on to windows, the language Toolbar is on the taskbar; and
every time I log on, I remove it. How can I get it to stay off? Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103787
Is it possible to display deleted row(s) in DataGrid
Is it possible to make the DataGrid shows a row with RowState ==
DataRowState.Deleted?
(e.g. display a deleted row using another color and allow user to undo the
deletion)
thanks Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103786
Customizing the WebBrowser control
I am embeding the WebBrowser in my application to show reports. I
would like to embed the graphics and the CSS files in a resource. To
do this I need to "hook" the WebBrowser control so that when it goes
looking for these files, I can give it the files from the resource.
Any thoughts on how to do this? It does NOT look possible, at the
moment.
Sam Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103785
TopMost - affects realtime?
Suppose I have a form that loads with TopMost = True. If I change the form
to TopMost = False will it immediately affect the form -- in other words is
TopMost dynamic? The reason I ask is that I want to disable TopMost when
I'm displaying a Msgbox (otherwise the message box appears behind my form).
Rob. Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103784
OpenGL canvas in windows forms application
Hi all,
I need an opengl (2.0) canvas in a windows forms application using c++.
How can this be accomplished? I didnt find any ressources on the web...
Thanks in advance
Philipp Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103783
WebbrowserControl: Position of images in frame/iframe
Hi All,
I have a web browse control hosted in a windows form. I want to
calculate the coordinates of all the images present in the web page
displayed in the webbrowser. I am adding all the documents(main
document and the iframe/frame documents) in a HTMLDocument list on the
NavigateComplete2Event. I am using GetClientRects() to find the
coordiantes.
>From these documents I am able to get the correct image position if it
is the main browser document( i.e. when browserControl.Document.url =
documentFromList.url), but for other documents, it gives the displaced
image coordinates. The image, top-left coordinate returned for such
documents is usually wrt (0,0).However, they return correct anchor
coordinates.
Is there any other approach by which I can get the correct coordinates
for the images in iframe/frames?
Thanks,
Nupur Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103781
ListView sort only sorts on paint?
Has anyone notices this behavior?
I have a composite control that contains a listview. I've created my
own listviewsorter class that works just fine. As items get added (in
this case - a very small #, less than 40), I repaint all items
background to white, sort, and perform a colorization.
The code was supposed to colorize some things in an alternating
pattern, but i noticed sometimes it wasn't alternating. What I found
was although my colorization colored the correct items - the sort
wasn't happening until the parent that housed the composite control got
redrawn!!!
I tried a Refresh, an Update, a ResumeLayout, RedrawItems, etc. Nothing
got this to work with the listview. I did code around it myself with a
sortedList, but I find it odd that when I call ListView.Sort it just
seems to queue up the sort for the next paint operation.
Am I mistaken? Does anyone know how this really works? Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103780
DataGridView CellValueChanged event not firing
I have a DataGridView that is bound to a list of objects through it's
datasource property.
If a cell in the grid is changed by editing directly in the cell I get
a CellValueChanged event.
If the value is changed in the underlying object that causes the cell
in the grid to get changed then the CellValueChanged event does not
occur.
Does anyone know of a way to detect a cell value changing for both
cases? I would like to detect the value change without leaving the row
since I am trying to give immediate visual feedback regarding the
validity of the data being entered and don't want the user to have to
leave the row to find out if data in a cell is valid. Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103777
Question about SizeDataGridColumnToContent function...
Using C#
string xmlfile = "appsettings.xml";
DataSet ds_login = new DataSet();
ds_login.ReadXml(xmlfile);
dgConnection.DataSource = ds_login;
dgConnection.DataMember = "Connection";
SizeDataGridColumnsToContent(dgConnection, 1);
The function works the way it is suppose to for every other datagrid I
have.
But for the one bound to the dataset with the XML I get an extra column
added.
the column is Connections_Id where Connections is an element name...
The column DOES NOT show up if I don't use the
SizeDataGridColumnsToContent function.
here is the function:
public void SizeDataGridColumnsToContent(DataGrid dataGrid, int
nRowsToScan)
{
//first check to make sure the DataGrid has a
valid datasource
if (dataGrid.DataSource == null)
{
//it does not
return;
}
// Create graphics object for measuring widths.
Graphics Graphics = dataGrid.CreateGraphics();
// Define new table style.
DataGridTableStyle tableStyle;
//necessary b/c of the DataSet looping
int nRowsToScanOriginal = nRowsToScan;
bool scanAllRows;
if(-1 == nRowsToScan)
scanAllRows = true;
else
scanAllRows = false;
try
{
if (dataGrid.DataSource.GetType() ==
typeof(DataSet))
{
DataSet dataSet =
(DataSet)dataGrid.DataSource;
if(dataSet.Tables.Count == 0)
{
//if the DataSet it
empty, nothing to do
return;
}
// Clear any existing table
styles.
dataGrid.TableStyles.Clear();
foreach(DataTable dataTable in
dataSet.Tables)
{
if (scanAllRows)
{
nRowsToScan =
dataTable.Rows.Count;
}
else
{
// Can only
scan rows if they exist.
nRowsToScan =
System.Math.Min(nRowsToScanOriginal,
dataTable.Rows.Count);
}
// Use mapping name
that is defined in the data source.
tableStyle = new
DataGridTableStyle();
tableStyle.MappingName
= dataTable.TableName;
// Now create the
column styles within the table style.
DataGridTextBoxColumn
columnStyle;
int iWidth;
for (int iCurrCol = 0;
iCurrCol <
dataTable.Columns.Count; iCurrCol++)
{
DataColumn
dataColumn = dataTable.Columns[iCurrCol];
columnStyle =
new DataGridTextBoxColumn();
columnStyle.TextBox.Enabled = true;
if(dataColumn.Caption != "")
{
columnStyle.HeaderText = dataColumn.Caption;
}
else
{
columnStyle.HeaderText = dataColumn.Caption;
}
columnStyle.MappingName = dataColumn.ColumnName;
// Set width to
header text width.
iWidth =
(int)(Graphics.MeasureString
(columnStyle.HeaderText,
dataGrid.Font).Width);
// Change
width, if data width is
// wider than
header text width.
// Check the
width of the data in the first X rows.
DataRow
dataRow;
for (int iRow =
0; iRow < nRowsToScan; iRow++)
{
dataRow
= dataTable.Rows[iRow];
if
(null != dataRow[dataColumn.ColumnName])
{
int iColWidth = (int)(Graphics.MeasureString
(dataRow.ItemArray[iCurrCol].ToString(),
dataGrid.Font).Width);
iWidth = (int)System.Math.Max(iWidth, iColWidth);
}
}
columnStyle.Width = iWidth + 4;
// Add the new
column style to the table style.
tableStyle.GridColumnStyles.Add(columnStyle);
}
// Add the new table
style to the data grid.
dataGrid.TableStyles.Add(tableStyle);
}
}
else if(dataGrid.DataSource.GetType()
== typeof(DataTable)) //the
datagrid just has a DataTable
{
tableStyle = new
DataGridTableStyle();
DataTable dataTable =
(DataTable)dataGrid.DataSource;
if (-1 == nRowsToScan)
{
nRowsToScan =
dataTable.Rows.Count;
}
else
{
// Can only scan rows
if they exist.
nRowsToScan =
System.Math.Min(nRowsToScan,
dataTable.Rows.Count);
}
// Clear any existing table
styles.
dataGrid.TableStyles.Clear();
// Use mapping name that is
defined in the data source.
tableStyle.MappingName =
dataTable.TableName;
// Now create the column styles
within the table style.
DataGridTextBoxColumn
columnStyle;
int iWidth;
for (int iCurrCol = 0;
iCurrCol <
dataTable.Columns.Count; iCurrCol++)
{
DataColumn dataColumn =
dataTable.Columns[iCurrCol];
columnStyle = new
DataGridTextBoxColumn();
columnStyle.TextBox.Enabled = true;
if(dataColumn.Caption
!= "")
{
columnStyle.HeaderText = dataColumn.Caption;
}
else
{
columnStyle.HeaderText = dataColumn.ColumnName;
}
columnStyle.MappingName
= dataColumn.ColumnName;
// Set width to header
text width.
iWidth =
(int)(Graphics.MeasureString
(columnStyle.HeaderText,
dataGrid.Font).Width);
// Change width, if
data width is
// wider than header
text width.
// Check the width of
the data in the first X rows.
DataRow dataRow;
for (int iRow = 0; iRow
< nRowsToScan; iRow++)
{
dataRow =
dataTable.Rows[iRow];
if (null !=
dataRow[dataColumn.ColumnName])
{
int
iColWidth = (int)(Graphics.MeasureString
(dataRow.ItemArray[iCurrCol].ToString(),
dataGrid.Font).Width);
iWidth
= (int)System.Math.Max(iWidth, iColWidth);
}
}
columnStyle.Width =
iWidth + 4;
// Add the new column
style to the table style.
tableStyle.GridColumnStyles.Add(columnStyle);
}
// Add the new table style to
the data grid.
dataGrid.TableStyles.Add(tableStyle);
}
}
catch(Exception e)
{
MessageBox.Show(e.Message);
}
finally
{
Graphics.Dispose();
}
}
Here is the XML file also if that helps...
<?xml version="1.0" encoding="utf-8" ?>
- <AppSettings>
- <DatebaseConnections>
- <Connection>
<Server>DSS-SERVER3</Server>
<Database>ClientScanTest</Database>
</Connection>
</DatebaseConnections>
- <LoginSettings>
<Admin>GaKFQUS2Oo92F6byJQGbEg==</Admin>
</LoginSettings>
</AppSettings>
This is the Output also...
Server Database DatabaseConnections_Id
DSS-SERVER3 ClientScantest 0
as seen in the datagrid the dataset is bound to. Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103775
Select a row of a DataGridView control with a certain column value
Hi all out there,
how can I select a row of a DataGridView control with a certain column value?
What I need is something like a "RowDataBound" event, but I did not found
this functionality in the DataGridView control.
Background:
I've got a DataGridView connected to a BindingSource.
The User changes the sorting and then selects a row and hits the Edit button.
Another form opens in which the user edits the detail data.
If the detail form is closed, the data of the first form should be updated and
then the originally selected row should be again selected (more exactly: the
row with a certain value in a column, lets say where id=27).
Thanks a lot for your help
Ulrich Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103774
Video Capture
Hi, hope someone can help. I am trying to capture video in my application. I
have been using Capturepro by Pegasus. However it is very slow when doing the
initial connection to the camera. Does anyone know of a component that is
quicker?
Thanks in advance.
Dave Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103767
Textbox Control
Hello,
I have a textbox with data in it that extends beyond the size of the text
box. I am looking for a way to display the data in the textbox with the
data scrolled all the way to the right:
Before:
-------------------
| Peter Piper|
-------------------
After What I Want:
------------------
|led Pickels.|
------------------
The text is justified to the right (I already tried it with setting the text
justification to the right with no luck).
Thanks,
Chuck Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103761
ReportViewer Control Local Report not showing all records/rows
I am dynamically creating a ReportViewer control and loading a local report.
After adding appropriate datasources, the ReportViewer intermittently does
not show all the rows/records that should be displayed (e.g. only showing 2
when there should be 4). Refresh will usually correct the problem but that
is not a preferred fix.
Anybody else run into this and have a solution?
Thanks.
Darrin McQuay Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103757
Tooltip Font
Hi all,
I'm writing a program where I have to draw custom tooltips onto a control
through OnPaint. I've figured out how to get the text color and the box
color (KnownColor.InfoText and KnownColor.Info), but I can't find anywhere
how to figure out what the font is. I've looked through the WinAPI and
others...maybe I'm just missing it, I dunno. Seems like it should be there
somewhere, though.
(These are what the user would set through the display settings in Windows.)
Thanks in advance for any help. Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103756
How to override Combobox drop-down effect
I am trying to prevent the combobox from dropping down; how do I
override this effect?
Thank you.
-
ed Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103755
DSOFramer and .NET Menus
Apologies for the cross-posting - not sure where best to post......
Okay, this might be a shot in the dark since there are very few
(positive) postings regarding the DSOFramer control but I'll give it a
shot posting my problem anyway....
I'm trying to use the DSOFramer in a Visual Studio 2005 Windows Forms
project (using C#). The configuration is simple. Using the standard
tools provided with Visual Studio I have a main menu at the top with a
toolbar just under it. A status bar is docked to the bottom and in the
middle docked "fill" is the DSOFramer control. I am loading an Excel
spreadsheet into the DSOFramer control. Here's the problem:
1. Click the "File" menu item from the main menu in the Windows Form
(not the File menu in exposed by Excel).
2. Leave the menu in the expanded, dropped-down state.
3. Click anywhere on the Excel spreadsheet in the DSOFramer control.
4. The menu DOES NOT collapse.
I have tried a number of combinations: .NET 1.1, third-party menu
controls. Nothing works. The only control combination that does work is
using Visual Studio 2003 and using the standard MainMenu control
provided by Visual Studio. This seems to work okay HOWEVER, this
control is very bland (does not allow for command icons) and is not
useful for my project.
In order to debug the problem I have also tried the following:
1. Capture EVERY event exposed by the DSOFramer control. No events are
fired (such as Leave and Enter) when I click on and off of the hosted
spreadsheet.
2. Ran the program using Spy to see what Windows messages were being
sent. It appears WM_NOTIFYPARENT is sent but apparently .NET 2.0
ignores it (as does .NET 1.1). I'm no expert on Windows messages so
perhaps I'm missing something rather than .NET!
Any and all help is much appreciated. Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103753
determine which control will get the focus
When handling the Lost_Focus event, is there a way to determine which control
will get the focus before leaving the Lost Focus handler ? and then prevent
the current control to not loose the focus ? Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103752
Cancel selection in ListView on MouseClick
I would like to cancel the selection of the ListViewItem in the
ListView on MouseClick?
Any help would be appreciated.
Etienne Lebeau, ing. jr.
Software Designer
Matrox Graphics
etienne.lebeau@matrox.com Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103751
CAn not send email from winform VB.net app
I am trying to send email through an SMTP server from my VB.NET 2.0 winform
application. I keep getting an error: "Unable to connect to the remote
server".
Here is my code:
Dim sTo As New MailAddress(to@mymail.com)
Dim objMail As New MailMessage(sSender, sTo)
objMail.IsBodyHtml =
True
objMail.Subject =
"Testing"
objMail.Body =
"Body Test"
Dim SmtpMail As New SmtpClient
SmtpMail.Host =
"smtp.remotesmtpserver.com"
SmtpMail.Send(objMail)
Can anyone please help me? Most of the help I have seen is for ASP. This is
NOT a web app.
Thanks,
--
enak Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103750
CAn not send email from winform VB.net app
I am trying to send email through an SMTP server from my VB.NET 2.0 winform
application. I keep getting an error: "Unable to connect to the remote
server".
Here is my code:
Dim sTo As New MailAddress(to@mymail.com)
Dim objMail As New MailMessage(sSender, sTo)
objMail.IsBodyHtml =
True
objMail.Subject =
"Testing"
objMail.Body =
"Body Test"
Dim SmtpMail As New SmtpClient
SmtpMail.Host =
"smtp.remotesmtpserver.com"
SmtpMail.Send(objMail)
Can anyone please help me? Most of the help I have seen is for ASP. This is
NOT a web app.
Thanks,
--
enak Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103749
adding images to grid columns? .net 1.1
I have a windows forms .net 1.1 question:
I tried adding an image (a picturebox) to a column in my grid, but haven't
been able to do it adequately. The pictures are there, but they don't seem
to be visible until I click on a cell and then the picture is visible. Not
sure what's going on.
Can you tell from the following code, or is there a better way:
Sub DoAssessmentGrid()
If bus.AssessmentList(ActionRequested.CaseNumber) Then
Dim ts As DataGridTableStyle
ts = dgAssessments.TableStyles(0)
ts.MappingName = "ClientAssessments"
Dim booleanColumn As DataGridBoolColumn
booleanColumn = ts.GridColumnStyles.Item("CompleteBool")
booleanColumn.TrueValue = True
booleanColumn.FalseValue = False
booleanColumn.NullValue = Convert.DBNull
Try
Dim executing_assembly As System.Reflection.Assembly =
Me.GetType.Assembly.GetEntryAssembly()
Dim my_namespace As String =
executing_assembly.GetName().Name.ToString()
If Not ts.GridColumnStyles.Item("Action") Is Nothing Then
ActionColumn = CType(ts.GridColumnStyles.Item("Action"),
DataGridTextBoxColumn)
ActionColumn.Alignment = HorizontalAlignment.Center
imgEdit = New PictureBox
imgExport = New PictureBox
Dim curDir As String = Environment.CurrentDirectory()
imgEdit.Image =
Image.FromFile("D:\OKDHS\AGING\ELDERS\ELDERSRemote\images\Edit.gif")
imgEdit.Cursor = Cursors.Arrow
imgEdit.SendToBack()
imgExport.Image =
Image.FromFile("D:\OKDHS\AGING\ELDERS\ELDERSRemote\images\btnExport.gif")
imgExport.Cursor = Cursors.Arrow
imgExport.SendToBack()
ActionColumn.TextBox.Controls.Add(imgEdit)
imgEdit.BringToFront()
'ActionColumn.Width = 65
'ActionColumn.TextBox.Controls.Add(imgExport)
End If
Catch ex As System.IO.FileNotFoundException
SystemMessage.Tell("Couldn't find one of the image files for
the grid")
Catch ex As Exception
End Try
dgAssessments.DataSource = bus.ObjectDataSet
dgAssessments.DataMember = ts.MappingName
End If
End Sub Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103740
Organise large amounts of controls in Designer
Hello Netizens,
I have an application with > 300 controls on several panes, all in one
Form. It gets a little bit difficult to manage all these in the Designer.
What is the correct way to solve this? I have only one form, but many
panes.
Tnx - Paul Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103738
SmartClient Sample
Hi!
I am new to SmartClient. Can anyone provide some links for SmartClient
sample or tutorials
Thanks,
Baren Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103732
Custom title bar drawing
Hello,
I'm trying to make a skinned application, so i'm overriding the paint
methods of the controls.
Concerning the painting of the form itself, it seems that there are 2
options:
- Making the form borderless (FormBorderStyle to None), and building
our own custom window title bar, but just think that this needs some
useless work as we have to rewrite some window functions (move, resize,
...). Moreover, when maximizing the window, it makes it fullscreen.
- This lead me to the second option which was to use the non client
area painting by catching the WM_NCPAINT message in the WndProc method.
With the help of some Win32 functions, i paint on the form
(FormBorderStyle to Sizable) but something weird happens, the system
buttons on the title bar redraw themselves, for example, when i move
the mouse over the window. So they appear on the custom painting...
Does someone have an idea of what happens with the
maximize/minimize/close buttons and/or have a workaround for the second
option ? Cannot find which message makes the buttons to be repainted.
Or is the first option the best solution to make a skinned application
?
Thanks for your help!
Valerie Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103731
Drag & Drop & Timer
When doing a Drag & Drop SWF.Timer don't seem to work anymore.
What can I do in such case?
For now, as the OnDragOver event seems to be fire repetitively I use it.
But I cannot control the time interval.
Any better idea? Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103730
Tab Control
Hi,
Is it possible to have tab control buttons on bottom?
With out going to to much trouble, thoug I have seen everywhere.
Jared. Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103724
.Visible = False not working...
I can't seem to make my form not visible. During the Load event I
specifically set Me.Visible = False but the form still displays?
Any suggestions ? Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103723
ToolStrip menu and MDI application
Hi all
Using VS2005 and .Net 2.0.
I have a MDI parent form, and MDI children. What I would like to do is
similar to merging menu's. I found you can define the menus on the
child, specify a merge index and have the menu merge nicely with the
MDI parents menu.
Ideas?
Thanks
Andy Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103714
Keeping ToolStrip inside the same ToolStripContainer
I would like to use multiple ToolTripContainers in my Form. I would like
the ToolStrips in each ToolStripContainer to be freely movable within its
container, but I would like to enforce a rule such that ToolStrips cannot be
dragged from one ToolStripContainer to another.
I am encapsulating each ToolStripContainer within a user control for several
reasons, code reusability and layout simplicity being the main ones. I was
hoping to simply implement a QueryContinueDrag handler in my UserControl but
it does not seem to be getting called as I drag the ToolStrip around the
screen.
I'm using VS2005, .NET 2.0. I'm a veteran MFC programmer, been working
with .NET for a couple of months - this is the first thing I've come up
against where I wasn't able to find a solution with a little elbow grease!
Any thoughts?
Thanks,
Mike T
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =---- Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103709
ListView Custom Sorting and repositioning later
I have a ListView with a custom ListViewItemSorter assigned. After I add all
the items I assign the sorter and everything is sorted fine. This works the
way I want.
Now I want the user to be able to move items within the ListView but they're
always resorted. If I try and set ListView.ListViewItemSorter = null then
the items are no longer sorted in the original order.
Any ideas how to work around this?
-Joe Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103706
Can't see "Windows Form Designer Generated Code" in VS2005
Folks,
I am developing a Visual Basic Windows application using Visual
Studio 2005. For some reason I do not see any of the code that is
normally generated by VB. Is there some setting/option I need to check
somewhere in the IDE?
Thanks,
Vint Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103701
Question about MDI application
I have an MDI application with the MDI parent container has a
tabcontrol on it. When I bring up any child MDI forms, it won't show
up over the tabcontrol. I have tried the form.bringtofront() and that
doesnt work. Short setting the controls visible property to false, I
can not figure this one out. Anyone have any ideas???? Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103699
Databinding: "BindingSource - field" syntax
Hi,
I have a question regarding databinding via the Visual Studio 2005 form
designer. What I wanted to do is not a very good practice, it was just
"quick and dirty" in really small application. I had a WinForms
form with a typed dataset and a lot of controls bound to it via
BindingSources. Because a lot of these fields are optional, and I
wanted to clean the form up, I added a little button invoking a second
(modal) form containing those fields. The latter only contained a
BindingSource that got hooked up to the typed dataset on the main form
(by passing a reference at creation) in runtime. (I passed the entire
dataset because i needed a few tables with reference data).
Knowing that the schema of the dataset will never change again I just
wanted to bind the controls on the second form to the bindingsource in
design time. Of course, the designer can't provide me with
DisplayMembers, etc...
I found that it was possible to manually set the DataBindings property
for Text and Tag using the " bindingsource - field" syntax, the
correct code is generated. For other fields, e.g. SelectedValue in a
combobox, this is not possible via the properties window.
I am curious now, is this a bug in VS2005 or is this supported? If so,
why doesn't the "bindingsource - field" syntax work for all
properties? Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103697
How to clone a refrenced type object?
Hello
I am developing a utility to be reused in other programs. It
I have an object of type Control (a TextBox, ComboBox, etc.) that other
programmers use it in applications. they may set some of properties or
assign event handlers. I need to be able to clone the manipulated control at
runtime.
I could use the Clone method of some objects (like Font, Style, String,
etc..) but the controls like Button, TextBox, ListBox doesn't have this kind
of method.
How can I create a clone of an object instance for controls like TextBox,
ListBox, ListViews, CheckBox ??
Any help is appreciated, Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103688
Hide form from Alt-Tab when first run
Hi All,
I would like to start a VB.Net 2.0 app minimised to the tray area. I use the
NotifyIcon component, set the form to start minimised by adding this to the
form.load event
Me.WindowState = FormWindowState.Minimized
Me.Hide()
and set the notifyicon component property to visible, so it shows in the
tray area. I have also set the showintaskbar property of the main form to
false.
All seems to work well when I run the app; the form does not show on the
taskbar, and I can see the notifiyicon's icon image in the task bar. The
problem is that the form icon is visible in the alt-tab switcher list.
However, if I double click the icon in the taskbar, which runs this code in
the notifyicon doubleclick event handler
Me.Show()
If (Me.WindowState = FormWindowState.Minimized) Then
Me.WindowState = FormWindowState.Normal
Me.Activate()
End If
NotifyIcon.Visible = False
and then minimise the form, which runs this code in the form.resize event
handler
If (Me.WindowState = FormWindowState.Minimized) Then
Me.Hide()
NotifyIcon.Visible = True
then now the form icon does not appear in the alt-tab switcher.
I don't understand what is happening when the form is first shown, that is
not happening when I restore and minimise the form. I have looked in these
newsgroups and on the net but I could not find the answer, so any clues as to
how to accomplish hiding the form from the alt-tab list when it first runs
would be much appreciated. Thanks. Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103687
novice help for combo box needed
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C6BB41.66804AF0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I am trying to emulate with ComboBox, what I do with a Web DropDownList.
dropdownList.Items.Add(new ListItem("30", "30 days"));
dropdownList.Items.Add(new ListItem("60", "60 days"));
As you can see, 30 and 60 are values and "30 days" and "60 days" for =
displaying. Not populating from the database here. I just want those =
two items to be in the combo box. Very simple.
Cannot for the life of me figure out how to do this. ComboBox.Items is =
an ObjectCollection, and I have no idea how to emulate the above. =20
So I decided to create table like this and populate.
DataTable table =3D new Table();
table.Columns.Add("Value");
table.Columns.Add("Display");
//and create rows with what I want to populate
DataRow row =3D table.NewRow();
row["Value"] =3D 30;
row["Display"] =3D "30 days";
table.Rows.Add(row);
cmbBox.ValueMember =3D "Value";
cmbBox.DisplayMember =3D "Display";
cmbBox.DataSource =3D table;
Now that seems like a lot of code for something very simple.
And the strangest thing is, when cmbBox.DataSource =3D table executes, =
the SelectedIndexChanged event fires! =20
PS: I am still using .NET 1.x. =20
------=_NextPart_000_0006_01C6BB41.66804AF0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2912" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff background=3D"">
<DIV><FONT face=3DArial size=3D2>I am trying to emulate with ComboBox, =
what I do=20
with a Web DropDownList.<BR><BR>dropdownList.Items.Add(new =
ListItem("30",=20
"30 days"));<BR>dropdownList.Items.Add(new ListItem("60", "60 =
days"));<BR><BR>As=20
you can see, 30 and 60 are values and "30 days" and "60 days" for=20
displaying. Not populating from the database here. I just =
want those=20
two items to be in the combo box. Very simple.<BR><BR>Cannot for =
the life=20
of me figure out how to do this. ComboBox.Items is an =
ObjectCollection,=20
and I have no idea how to emulate the above. <BR><BR>So I decided =
to=20
create table like this and populate.<BR><BR>DataTable table =3D new=20
Table();<BR><BR>table.Columns.Add("Value");<BR>table.Columns.Add("Display=
");<BR><BR>//and=20
create rows with what I want to populate</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>DataRow row =3D =
table.NewRow();</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>row["Value"] =3D 30;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>row["Display"] =3D "30 =
days";</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2>table.Rows.Add(row);<BR><BR>cmbBox.ValueMember =3D=20
"Value";</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>cmbBox.DisplayMember =3D =
"Display";</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>cmbBox.DataSource =3D =
table;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Now that seems like a lot of code for =
something=20
very simple.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>And the strangest thing is, when =
cmbBox.DataSource=20
=3D table executes, the SelectedIndexChanged event fires! =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>PS: I am still using .NET =
1.x. =20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0006_01C6BB41.66804AF0-- Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103684
Form Validate
I'm not getting the validation behavior I'm expecting in my
application.
My form has a TabControl which, among other controls, contains a
ComboBox.
The form also contains a BindingNavigator control to work with the
BindingSource.
The ComboBox is bound to another binding source. The ComboBox has a
DataSource from which its item collection is filled and its ValueMember
and DisplayMember properties are set.
The ComboBox DropDownStyle is set to DropDownList (so that the user
must select from the list, and cannot enter anything else not in the
list.)
In the form's class, I added a method to handle the ComboBox
Validating event.
In the form's Save Button I call Me.Validate().
When I set the form's AutoValidation to EnableAllowFocusChange I expect
that the ComboBox Validating event will be raised when the Save button
is clicked and Me.Validate() is invoked. Instead, the ComboBox
Validating event is raised when the ComboBox looses focus, even if the
SelectedIndex has not changed. However, it does allow the focus to
change, even if the Validating code executes an e.cancel.
Am I correct in what I'm expecting? Should the ComboBox Validating
event be raised when the Save button is clicked and I invoke
Me.Validate()?
Thanks, Bren Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103682
Writing to Standard Output from a Windows Forms application
I have a very simple Windows Forms application that I am enhancing to
also operate in command line mode. This seems simple enough... add some
command line arguments so the user can specify the desired behavior
without using the GUI and things should be fine. There is only one
problem... how do I get output back to the command line user? The
existing application writes the console with Console.WriteLine, but when
the application is a Windows Forms application, this just consumes the
output. It seems like the solution would be to set Console.Out to reset
the Console Out stream to the real standard output stream, but I can't
quite figure out how to do this. I realize Microsoft has made the
assumption that a Windows Forms application never has to write to
standard output, but this is not the first time I've had the need to do
precisely this. Any pointers (I'm afraid all of my searches have been
unsuccessful)?
Finally, if indeed this is not possible, how would you suggest I go
about implementing an application that can be driven either from command
line arguments or its GUI? One architecture that certainly would work
would be to have the intended command line be a console application, and
if no arguments are present, then launch a second application that is
the Windows Forms application. This certainly would work, but it sure
seems a very complex solution to what is really a simple application.
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103680
Listview using up GDI resources
I am using a windows forms listview control in my application. The listview
is created with 2 columns and filled in with data on the Load Event of the
form. At that point, the user is supposed to select an item from the
listview.
It seems that when the Listview control has the focus, the user can use
arrow keys, keyboard letters etc to move from one item to another. Also the
user can click on an item to select it.
This seems to be operating properly in Windows 2000 and XP. On windows 98,
this same application quickly uses up all of the GDI resources.
My understanding of this problem is that every time the selected item of the
listview is changed the control redraws itself. During the redraw it
allocates memory for something (possibly to create a GDI drawing pen). It
seems that it is not releasing the memory cleanly ie waitng for the garbage
collector to release the resource. If that doesnt happen in time (before the
next redraw) the GDI resources start to get used up.
Is there any way to prevent this from happening??? Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103678
Text written with TextRenderer overwritten by other Controls?
Hi everyone.
I'm trying to write text to a Windows Form with TextRenderer.Drawtext,
and it works fine - until I select an item from the Menu
(System.Windows.Forms.MenuStrip) above it - at which point any text in
the Form area underneath where the menu drops down gets erased.
Here's the code I'm using to write to the Form - from a method within my
Form class:
Graphics g = this.CreateGraphics();
TextRenderer.DrawText(g, "Some Text", this.Font, new Point(10, 50),
SystemColors.WindowText, TextFormatFlags.Default);
If I put a Text Control on the form at design time in VS05, that Text
Control DOESN'T get overwritten.
So, text that I'm adding manually at runtime with TextRenderer appear
but gets stomped on by other Controls, while Controls (eg: TextControl)
added at design time are preserved.
Any ideas? I'm stumped and assume there's something that I need to call
in terms of Suspending Layout or Resuming or something like that, but no
idea what.
Thanks for any/all help!
- J Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103674
CHM file and webbrowser component
Hi group,
I want to show a particular html page from a chm file in the webbrowser
component (.NET 2.0). It works if I have the chm file on disk and make the
webbrowser navigate to it via the mk:@MSITStore url (i.e.
webbrowser.Navigate("mk:@MSITStore:C:\foo.chm::/start.html")).
Now I want to embed the chm into my assembly and load it from there
directly into the webbrowser component (without storing it temporarily on
disk). I thought I could use webbrowser.DocumentStream and set it to the
stream of the 'chm resource'. But how can I tell the webbrowser that this
stream is a chm and he has to navigate to a specific html page.
Perhaps there is a completely other aproach. Any hints are welcome.
Best regards,
Martin Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103673
Use webbrowser control w/o form ui
I'm trying to create a html/hta document on the fly without using the gray
form UI. I'll be activating the html/hta document from a parameter on the
context menu. Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103672
Using generic printer
Hello,
Is there a way to send a string of text to a generic tekst printer under
.NET.
Somethings as in the good old days
File f = Open("LPT1");
f.Writeline("Blablabla");
The goal is to use an old lineprinter as a log printer printing out each
line (incomming allert) at a time without having to build a whole page
before printing.
Greets,
Jean Paul Tag: How to set ImeMode for the datagridviewtextboxcolumn? Tag: 103668
How to set ImeMode for the datagridviewtextboxcolumn?
I want to disable ime each cells on datagridview when editing.