How to: Display Long Strings in Debug Watch Window?
I'm using VSNET for my environment.
I need to step through my code and watch long strings get parsed.
Any way I can setup a watch that will let me do this?
Thanks,
Steve Tag: XP Icon library Tag: 54953
Where is the Column collection in a DataGrid?
How do I access the Column collection in a bound DataGrid?
Example:
DataGrid.DataSource = ds.Tables("MyTable") Tag: XP Icon library Tag: 54952
Threading Error
I'm getting the following error in my Event Viewer
Application Log:
Description:
Faulting application devenv.exe, version 7.0.9466.0,
faulting module mscordbi.dll, version 1.0.3705.0, fault
address 0x0000f64a.
I'm using the following routine:
Dim skt As New SBSockets()
skt.IP = dr.Item("IPAddress")
skt.RemotePort = dr.Item("Port")
Thread = New System.Threading.Thread(AddressOf
skt.StartListening)
Thread.Start()
When the code reaches the Thread.Start line of code, it
crashes, and asks if I want to report the error to MS and
restart my development environment.
I got W2000 PRO SP4.
Framework 1.0
384 RAM
Any help on how to solve this will really be appreciated!
TIA Tag: XP Icon library Tag: 54951
Docked window
Hi,
I am new to programming in .NET.
I would like to create a window that would dock to one side of the parent
window. Much like the property window in Visual Studio .NET.
So I thought that I would create a mdi application with a child window
performing as the property window. Though I believe this is the wrong way to
go about it. Since the child window would not behave as those mentioned.
How do I accomplish this using the .NET Framework?
Thank you,
Ernesto Herrera Tag: XP Icon library Tag: 54950
comboBox TextChanged event fires twice because Items.Insert() fires the event too...
Hi, I have a simple windows form, with two ComboBox controls (and
several other controls). For both of the comboBox controls,
DropDownStyle=DropDown.
For some reason that I can't figure out, when the user pastes text
into the comboBox, the event fires twice. At first I didn't notice
this, but once I added error checking, I started seeing my error
twice. Here some example code:
private void comboBox_doit_TextChanged(object sender, System.EventArgs
e)
{
...
comboBox_doit.Items.Insert(1,comboBox_doit.Text);
...
}
Does anyone know how to prevent the second event from firing? I have
tried using BeginUpdate() & EndUpdate() around Items.Insert(), I have
tried using a simple bool semaphore, I have even tried unregistering
the event before calling Items.Insert(), and then adding a new event
handler after it...
I also can not figure out why this only happens to one of my
comboBoxes, and not the other one... Hmmm...
Alas, I am stuck... I would be grateful for any comments, suggestions,
or advice...
Many Thanks,
-Rob. Tag: XP Icon library Tag: 54942
Is there a Post Load event? Trying to set selected indeces on bound combo boxes.
I've discovered that if you bind a data table to a combo box, and set the
selected index to -1 and or the Text to "", it doent work during The Load
event. If you do it somewhere later, it does. That brings up the question
of is there a post load event in the .NET framework. I looked for one but
didnt find it. MFC has something like that, though the name escapes me at
the moment, something like PostInit or something.
Thanks,
Glorfindel Tag: XP Icon library Tag: 54941
Crystal kills .NET app
I have an application that uses the Crystal Windows forms
viewer to display reports. The reports are populated
with data from a strongly-typed dataset. The app runs
fine on the development machine, but not on client
machines.
The form with the report viewer displays properly. Then
I click a button to display a report in the viewer. I
have figured out that the viewer's ReportSource property
is set successfully to point to a valid dataset. But
when the viewer starts to render the report, *the
application exits.*
I have spent hours with Crystal tech support on this, so
I thought I'd check here to see if anyone has encountered
anything similar.
FWIW, there seems to be a low level error occurring of
the "object reference not set" type just before the app
exits. Also, I am using all the latest merge modules and
valid licensing info.
Thanks for any help,
Matt Gould Tag: XP Icon library Tag: 54940
Please Help: ComboBox is closed on first click in IE hosted control
Hello,
I have a winforms control hosted in the IE that contains couple of
CombBoxes. I have found a strange behavior: when the control is first loaded
into IE, then if you first click on the one of the combos it drops down and
immediately closes. It behaves normally on second try. If you first click on
any other control and after that on the combo then it works as normal.
Therefore I think it has something to do with the control gaining focus at
the same time but I haven't managed to solve it by selecting it explicitly.
Have you experienced similar problem? Does anyone know how to solve this?
Thanks for your help and happy weekend,
Szymon Kobalczyk
Apriso Poland. Tag: XP Icon library Tag: 54928
Please Help: Message Filter on IE hosted control
Hi,
I write an IE hosted WinForms control. I need to add some global shortcut
keys. I found quite easy to do this by implementing an IMessageFilter.
Unfortunatelly this seems not working with IE although it does work when the
same control is run in standard form.
When I debuged it in the IE I see that Load event where I placed
Application.AddMessageFilter gets executed. But then the PreviewMessage
method is not.
First I thought it is a security issue (I think message filtering requires
access to unmanaged code) but it runs from a full trusted source.
Hence my questions are:
* Has anyone experienced such behavior?
* Anyone knows how to avoid it?
* Does anyone has any alternative solution for global shortcut keys ?
Regards,
Szymon Kobalczyk
Apriso Poland Tag: XP Icon library Tag: 54927
layout for printing
I have a report in a reprot viewer this report is in landscape form put when
I print it out I prints in portrait.
how do i set the layout to landscape so the user does not have to change it
to landscape when they hit the print button?
darren Tag: XP Icon library Tag: 54923
Exracting images from a WinForm app
This is a multi-part message in MIME format.
------=_NextPart_000_0063_01C36891.23241620
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Is there a way to extract the icons/images from a WinForm application? =
Anyone know of the copyright info as well? For example, I like the =
icons in the WebMatrix application and would like to simply look at them =
in more detail... with a graphic application. If it's ok, would like to =
use them in some of my apps, but concerned about the copyright side.
------=_NextPart_000_0063_01C36891.23241620
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.2800.1226" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000080 size=3D2>Is there a way to extract the =
icons/images from=20
a WinForm application? Anyone know of the copyright info as =
well? =20
For example, I like the icons in the WebMatrix application and would =
like to=20
simply look at them in more detail... with a graphic application. =
If it's=20
ok, would like to use them in some of my apps, but concerned about the =
copyright=20
side.</FONT></DIV></BODY></HTML>
------=_NextPart_000_0063_01C36891.23241620-- Tag: XP Icon library Tag: 54919
WebMatrix Source?
This is a multi-part message in MIME format.
------=_NextPart_000_0058_01C36890.9D3E9710
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Anyone know of plans to release the source code for WebMatrix? It's a =
slick and fast IDE... moreso than SharpDevelop. Since it's a free =
project, would make a great case study (similar to TaskVision).
-AC
------=_NextPart_000_0058_01C36890.9D3E9710
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.2800.1226" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000080 size=3D2>Anyone know of plans to release the =
source code=20
for WebMatrix? It's a slick and fast IDE... moreso than=20
SharpDevelop. Since it's a free project, would make a great case =
study=20
(similar to TaskVision).</FONT></DIV>
<DIV><FONT color=3D#000080 size=3D2></FONT> </DIV>
<DIV><FONT color=3D#000080 size=3D2>-AC</FONT></DIV></BODY></HTML>
------=_NextPart_000_0058_01C36890.9D3E9710-- Tag: XP Icon library Tag: 54918
Chocolate IDE for .NET
I am in the procces of creating a screen designing tool for an
existing application, this tool will be used by non-technical people.
The user needs to be able to add controls to a screen and move them
around. Adding controls to a form at runtime and moving/resizing is
not a problem, but I am looking for an easy way make the controls look
like they do in the IDE, in other words they don't fire the events.
short of creating a custom control for each of the controls, that
inherits the original control, I cannot find a way to do this. Any
help or ideas would be good.
Cheers
Pete Tag: XP Icon library Tag: 54908
NotifyIcon remains after abnormal termination
Hello - the NotifyIcon for my application remains in the system tray
if the application is abnormally terminated. Is there anyway I can
clean this up - either by the application (NotifyIcon.Dispose()
doesn't help) or by another application that could force a
repaint/repopulation of the system tray?
A litle bit more background. I have written an application which, when
run with certain command line arguments, will kill other instances of
itself. Unfortunately, it does leave the NotifyIcons visible.
Thanks very much for you help
Lee Tag: XP Icon library Tag: 54903
Odd behavior with ActiveX control on a Windows Form
Hi
When putting a VB6 built ActiveX control on a Windows Form
you get several troubles concerning focus in that form.
First of all the Enter and Leave events for the ActiveX
control only fires once.
Then if you got a button on the form that lies directly on
the Windows Form and presses this, it gets
the "Acceptbutton" shade and whenever you press Enter it
will be clicked. This is OK, but when you set focus on the
ActiveX control again, the "AcceptButton" shade will not
disappear. While having focus on the ActiveX control, any
subsequent keypresses on the Enter-key will fire the click-
event on that button and make the user very confused about
what happened.
Is there something you could do when writing that VB6
ActiveX control to avoid this behavior, or is this a
general bug concerning all ActiveX controls being placed
on Windows Forms?
Please let me know if you've got the answer!
/Patrik Karlsson Tag: XP Icon library Tag: 54896
starting form won't appear
I have a simple form called frmTopicFromStart with a sub
main in modPrimary. Here is the code for both. In the
form I have a tabcontro with 2 tabs and a quit button.
But when I start the app a no longer existing form1
appears on the screen with no controls. I checked
carefully. The starting entity is submain. form1 no
longer exists. I changed the file and form names to
TopicFromStart and frmTopicFromStart. What's going on.
Module modPrimary
Friend gstrConn As String
= "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=H:\Program Files\Microsoft Office\Office10
\Samples\Northwind.mdb;"
Public Sub Main()
Application.Run(New frmTopicFromStart)
End Sub
End Module
Public Class frmTopicFromStart
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form
Designer.
InitializeComponent()
'Add any initialization after the
InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component
list.
Protected Overloads Overrides Sub Dispose(ByVal
disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the
Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents btnQuit As
System.Windows.Forms.Button
Friend WithEvents TabControl1 As
System.Windows.Forms.TabControl
Friend WithEvents TabPage1 As
System.Windows.Forms.TabPage
Friend WithEvents TabPage2 As
System.Windows.Forms.TabPage
<System.Diagnostics.DebuggerStepThrough()> Private
Sub InitializeComponent()
Me.btnQuit = New System.Windows.Forms.Button
Me.TabControl1 = New
System.Windows.Forms.TabControl
Me.TabPage1 = New System.Windows.Forms.TabPage
Me.TabPage2 = New System.Windows.Forms.TabPage
Me.TabControl1.SuspendLayout()
Me.SuspendLayout()
'
'btnQuit
'
Me.btnQuit.Location = New System.Drawing.Point
(504, 456)
Me.btnQuit.Name = "btnQuit"
Me.btnQuit.Size = New System.Drawing.Size(80, 40)
Me.btnQuit.TabIndex = 1
Me.btnQuit.Text = "&Quit"
'
'TabControl1
'
Me.TabControl1.Controls.Add(Me.TabPage1)
Me.TabControl1.Controls.Add(Me.TabPage2)
Me.TabControl1.Location = New System.Drawing.Point
(168, 48)
Me.TabControl1.Name = "TabControl1"
Me.TabControl1.SelectedIndex = 0
Me.TabControl1.Size = New System.Drawing.Size
(432, 344)
Me.TabControl1.TabIndex = 2
'
'TabPage1
'
Me.TabPage1.Location = New System.Drawing.Point
(4, 22)
Me.TabPage1.Name = "TabPage1"
Me.TabPage1.Size = New System.Drawing.Size(424,
318)
Me.TabPage1.TabIndex = 0
Me.TabPage1.Text = "General"
'
'TabPage2
'
Me.TabPage2.Location = New System.Drawing.Point
(4, 22)
Me.TabPage2.Name = "TabPage2"
Me.TabPage2.Size = New System.Drawing.Size(424,
318)
Me.TabPage2.TabIndex = 1
Me.TabPage2.Text = "TabPage2"
'
'frmTopicFromStart
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5,
13)
Me.ClientSize = New System.Drawing.Size(648, 518)
Me.Controls.Add(Me.TabControl1)
Me.Controls.Add(Me.btnQuit)
Me.Name = "frmTopicFromStart"
Me.StartPosition =
System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Topic From Start"
Me.TabControl1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
End Class Tag: XP Icon library Tag: 54892
TextChanged event firing before the KeyXXX events
Hi all,
I have a combobox control, in wich I put an autocomplete code. This code is
in the TextChanged event, but when this event fires, the Text property isn't
updated yet.
For example, if the Text property is "Foo" and I press the letter "d", the
Text property when the TextChanged event runs is "Foo". Only after the
TextChanged event be processed, the KeyDown, KeyUp and KeyPress events fires
and update the Text property.
I think it's very strange. Is it a bug? How can I get the correct Text
property in the TextChanged event?
Thanks in advance,
Fabrício de Novaes Kucinskis. Tag: XP Icon library Tag: 54890
Select MenuItem Question
I'm building menus in code from a database. How do I
determine which menu item was selected? Does the
System.EventArgs contain this? If so, what property?
Here's the declaration:
Private Sub Menu_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Click
Thanks! Tag: XP Icon library Tag: 54887
Keep WinForm open on own thread
Hi,
I have a situation where I have a sub that is started on its own thread. The
sub opens a form which is supposed to stay open, and it does open for a
brief flash, but as soon as the sub ends, the form goes away.
This behavior makes sense to me, but I'm wondering how I can keep the form
open until the user is done filling it in, then close the form and abort the
thread.
Thanks in advance,
-George Tag: XP Icon library Tag: 54886
Pasting metafile from clipboard into picturebox control
Hi,
I am currently writing some code which copies an image in
the Windows metafile format pasted on the clipboard into a
picturebox control. For some reason, I have not been able
to get the following code to work:
Dim od As IDataObject = Clipboard.GetDataObject()
If (od.GetDataPresent(DataFormats.MetafilePict))
Then
PictureBox1.Image = CType(od.GetData
(DataFormats.MetafilePict, True), Metafile)
End If
When I switch the formats to Bitmap, everything works
fine, but when I use the EnhanceMetafile or the
MetafilePict formats, I get a blank picturebox.
I have been reading on the net about how there is a bug in
the framework with regards to metafile formats on the
clipboard but I don't know enough about the native API
calls to make heads or tails of it.
Any help would be appreciated.
Victor Tag: XP Icon library Tag: 54884
Problem placing components on inherited forms
Hello,
I am trying to create a custom control which inherits from
System.Windows.Forms.Form and can be used as a base class
for an application. So far so good.
I am also writing custom components which inherit from
System.ComponentModel.Component.
What I would like to know is if there is any way for my
custom form class can be made aware of these components?
The problem is that when my form class is instantiated at
design time via "Add Inherited Form" and I drop a
component on this form, the designer automagically extends
the base class by adding an IContainer
called "components". The component is then added to this
collection.
Is there any reasonably simple way to get these components
to act like controls and drop themselves into a nice
collection of my choosing? I also need the reverse link -
from component to form i.e. something comparable to the
Parent property of controls.
Thanks for all help.
Sincerely,
Markus
PS - for more background info, I started a thread on Aug.
19th '03 re: "How-to create user control replacing..." Tag: XP Icon library Tag: 54883
newbie C# Clicked event not firing
Hi All,
In a C# Windows project, My clicked event code did not
fire. First I had to actaully declare the method rather
than just adding the code and then in the
InitializeComponent I had to add:
this.button1.Click += new System.EventHandler
(button1_Click);
So that the event would run.
In vb.net this seems to be generated automatically. Do I
have a setting turned off somewhere in Visual Studio?
tia
Randy Tag: XP Icon library Tag: 54864
Form cannot be designed
I have recently installed v1.1 of the .NET framework, and
in the project I am working on, I have changed the
reference path to refer to the new framework. Now I get
an error message saying that "The base
class 'System.Windows.Forms.Form' cannot be designed"
If I change back to the older version of the framework it
seems to work fine, but I need to use some of the newer
classes only available in v1.1
All help will be most appreciated Tag: XP Icon library Tag: 54862
Printing Question
How do I select a printer tray when printing from VB.NET?
If I have "Tray 1" set as "Plain" in the printer driver and "Tray 2" set as
"Letterhead", how do I specify the paper type when printing so it goes to
the correct tray? Tag: XP Icon library Tag: 54857
SIMPLE question.
Hello all -
I have 2 VB.Net Win forms. When I'm through with using
Form #2, I just close it but what I want is trigger an
update event on Form #1 based on the activity inserts I
just did in Form #2. Is there an event that I can call
with the form being open already like frm1.<combo
box>.focus so I can trigger the update event.
I realize this a simple question but during the
converting to .Net idea, I don't want to create a new
instance of that form. So even a gotfocus or focus to
the form itself would be great. And any code of how that
is constructed.
Much thanks and cheers!
Mark Tag: XP Icon library Tag: 54852
vbdotnetforums.com site available
This is a multi-part message in MIME format.
------=_NextPart_000_006A_01C367C5.1E568230
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello all,
Just announcing a free site for VB.NET discussions. Visit the new =
resource at http://www.vbdotnetforums.com and share your VB.NET =
expertise.
Neal
------=_NextPart_000_006A_01C367C5.1E568230
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.2800.1226" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DVerdana size=3D2>Hello all,</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>Just announcing a free site for =
VB.NET=20
discussions. Visit the new resource at <A=20
href=3D"http://www.vbdotnetforums.com">http://www.vbdotnetforums.com</A> =
and share=20
your VB.NET expertise.</FONT></DIV>
<DIV><FONT face=3DVerdana size=3D2></FONT> </DIV>
<DIV><FONT face=3DVerdana size=3D2>Neal</FONT></DIV></BODY></HTML>
------=_NextPart_000_006A_01C367C5.1E568230-- Tag: XP Icon library Tag: 54845
Check style for C#
How you guys go for checkstyle of your C# code?
For our C# project we have some code design guide lines as to whether barces
are in place and whethere lines are upto
We have FxCop and its working great but that is for checking binaries and
not for checking source code styles.
We are looking something of the sort of CheckStyle and PMD of java world.
Awaiting replies. Tag: XP Icon library Tag: 54839
Managing two connected forms
Hi all,
in my application I need to show a form that contains
text box where user can edit patterns. When text in the
text box changes, second form displaying the list of
items matching the current pattern is shown. The problem
is that I would like the first form to hide when focus is
moved to some other window _except_ for the second form.
I.e., user should have an opportunity to edit the pattern
in the text box and select items from the list at the
same time, but when it moves focus away both forms should
disappear.
How can I achieve this? Tag: XP Icon library Tag: 54838
custom drawing menu and MdiList
I have a nice custom drawing menu. One of the items is a MdiList and
dynamically shows the list of all open MdiChildren.
the problem is that the items that identify the mdichildren are not custom
drawn. I have no idea how it could be possible to perform also custom
drawing for these items.
at first glance this does not look like a big problem. after all, the
subitems could be drawn as standard menu items. but here comes the the
additional problem - the main menu item that has the MdiList item as the
subitem is incorrectly drawn because it gets sligthly wrong information
about its Bounds (in DrawItemEventArgs).
Big thanks for any help,
Wiktor Tag: XP Icon library Tag: 54837
Is there OpenFolderDialog?
I want the user to select a folder from the machine
through a FileOpenDialog kind of interface.
Is there any way so that i can ask the user to select a
folder instead of File?
Thanx and Regards,
Noor Tag: XP Icon library Tag: 54829
Problems in Connection pooling: Urgent
Hello All,
My windows application has a form that needs to display fresh data to the
user at short intervals (say every 10 seconds). For this purpose, I have
included a timer. On every timer tick, I perform the database related
operations to display the result to the user.
Note: Multiple instances of my application will be running at the same time
and hence the timer running in each instance and initiation database
operations.
With this approach, I started receiving errors like: Connection timed out.
The connection pool has reached its maximum size because every request to
the database opened and closed a connection. I changed the approach to:
Creating a single connection for the entire form so that all operations use
the same open connection. The connection is closed when the form closes.
Even then, I now get the following type of errors:
a) 8/11/2003 3:21:40 PM SqlUtility Execute Error: Transaction
(Process ID 73) was deadlocked on lock resources with another process and
has been chosen as the deadlock victim. Rerun the transaction.
TimeTic Calling sp_ProductionTestBackgroundTask at
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior,
RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at IMD.OM.Database.SqlUtility.Execute(SqlParameter& prmOutParam,
SqlConnection cnnCommon) in
d:\khyatis\work\projects\imd\imdom\misc\sqlutility.cs:line 595
8/11/2003 3:21:40 PM SC Status Start NSC Monitor Error: at
OM.Database.SqlUtility.Execute(SqlParameter& prmOutParam, SqlConnection
cnnCommon) in d:\xyz\work\projects\\misc\sqlutility.cs:line 608
at IMD.OM.SC.SCStatus.StartNSCMonitor(SqlConnection commonConnection) in
d:\xyz\work\projects\scstatus.cs:line 564System.Data.SqlClient.SqlException:
Transaction (Process ID 73) was deadlocked on lock resources with another
process and has been chosen as the deadlock victim. Rerun the transaction.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at IMD.OM.Database.SqlUtility.Execute(SqlParameter& prmOutParam,
SqlConnection cnnCommon) in d:\xyz\work\projects\\misc\sqlutility.cs:line
595
I need to get rid of the above problem.
Regards,
Mithun Tag: XP Icon library Tag: 54828
two-way databinding radio buttons on a windows form?
Hi,
How do I get the data in the dataset to update when the
radio buttons change? Do I need to add code for this, or
shouldn't it happen automatically?
Strangely, I have a situation where the radio buttons
update the dataset when they get set, but not when they
get unset - so all the fields in the ds end up with true
values - which cause problems when the form refreshes the
data. So I isolated the code in a mini sample and this
doesn't update the datasets at all...
Thanks!
Heidi Tag: XP Icon library Tag: 54825
VB.NET command line question
How can I tell my VB.NET application to return info to the
command line that called it? For example, if I run
c:\myvbnetprogram.exe from the command line, how can I get
it to put something back on the same command line
like "hello world"??
thanks Tag: XP Icon library Tag: 54811
Toolbar buttons
Hi,
If I set a very long text string on a toolbar button, the
string is truncated. Even if I make the button higher, the
text does not get displayed on several lines as it would
if I had ordinary button.
How can I fix this (short of making the button very wide)?
Thank you Tag: XP Icon library Tag: 54806
Finding TEXT of DataGrid Column
I am trapping the MouseDown event and am looking to get the value of the cell
and also the Column name.
I can get the value of the cell with the code below. I can also get the Column name
if the DataGrid has a TableStyle. The problem comes when the DataGrid uses the
default TableStyle.
Using the debugger I walked down the class structure and could find the information
at this point
dataGrid1.Controls[hti.Column].dataGrid.defaultTableStyle.gridColumns.List._items
I can't seem to find my way there at design time, programmatically.
Any help would be appreciated.
Dave
DavidElliott@BellSouth.net
=======================================================
if (e.Button == MouseButtons.Right)
{
DataGridTableStyle ts1;
gridBoxText = "";
if (hti.Type == DataGrid.HitTestType.Cell)
{
gridBoxText = dataGrid1[hti.Row, hti.Column].ToString();
ts1 = dataGrid1.TableStyles["JobRecordCollection"];
if (ts1 != null)
gridHdrText = ts1.GridColumnStyles[hti.Column].HeaderText;
else
gridHdrText = dataGrid1.Controls[hti.Column].Text;
}
else if (hti.Type == DataGrid.HitTestType.ColumnHeader)
{
gridHdrText = dataGrid1.Controls[hti.Column].Text;
}
}
} Tag: XP Icon library Tag: 54805
Detecting DragDrop target when dropped into Explorer
I have an application which i need to allow a user to perform drag & drop of
a "virtual file" into explorer. Upon dropping the file into explorer, my app
would create a blank file at the location and begin downloading data into
it.
I can get the app to create an empty file for use with the DoDragDrop(),
which essentially moves a blank file (e.g. "%TempFolder%\foo.txt") into the
proper destination, but there doesn't appear to be any method of retrieving
the location of the FileDrop where explorer has moved this file to.
Any ideas? Tag: XP Icon library Tag: 54800
ComboBox : display different string than the selected list item
What I'm trying to do :
- Add a form to a new project
- Add a comboBox to the form with DropDownStyle = DropDown
- In form load :
ComboBox1.Items.Add("01 - USA")
ComboBox1.Items.Add("31 - Holland")
ComboBox1.Items.Add("33 - France")
ComboBox1.Items.Add("41 - Switzerland")
The desired behaviour is that when a user selects a list item only the
number is displayed in the textbox part of the comboBox. So if "01 -
USA" is selected only "01" should be displayed.
Roughly translating the way this would be done in VB6 I tried the
following code :
Private Sub ComboBox1_SelectionChangeCommitted( _
ByVal sender As Object, ByVal e As System.EventArgs) _
Handles ComboBox1.SelectionChangeCommitted
Dim listItemText As String
If ComboBox1.SelectedIndex >= 0 Then
'Calculate and store the value we want to display
listItemText = ComboBox1.SelectedItem.ToString
If listItemText.Length >= 2 Then
listItemText = listItemText.Substring(0, 2)
End If
'Cancel the selection
ComboBox1.SelectedIndex = -1
'Update the textbox part
ComboBox1.Text = listItemText
End If
End Sub
However this doesn't work. I've also tried experimenting with the
SelectedValueChanged, SelectedIndexChanged and TextChanged events,
with no better results. It seems that changing the selectedIndex in
any of these routines always cancels out changes made via the text
property, whatever the order the operations are carried out in.
I've finally resorted to using a timer to update ComboBox1.Text after
all these events have finished firing, but it's a very shoddy
solution.
Surely there must be a way to do this properly? Tag: XP Icon library Tag: 54795
How to select a group of cells?
Hi.
I need to allow my users to select groups of adjacent cells, instead
of selecting a row. For example, if my row has five cells I need to be
able to select cells 2,3 and 4. I can only find ways to select entire
rows but not groups of cells.
Thanks,
Robert Scheer Tag: XP Icon library Tag: 54794
How to sync combo's selected item to the field's value of the current record
I'm running win2k and VB.NET (.net 1.1)
I have a data entry form and one of the fields is a combo who's datasource
is a dataview. The dataview has 2 columns, an ID column - integer, and a
name column - string. The form is not databound so the form gets populated
with data for the selected reocord via values from a business class. When
the use selects an item from this combo's dropdown list, it writes the ID
value to the business class, and desplays the name value in the combo.text
property. When I navigate to a different record, the ID value changes for
this field. How can i get the combo to syncronize to this ID value, or at
least set the combo's text to the correct Name? Only the ID values are
persited in the business class and not the name values. In MS Access and
some 3rd party combos for VB6 all you had to do was set the combo's value to
the ID and it automaticly scrolled to the correct item in the dropdown.
Thanks.
--
George Padvorac
georgep@dontspamme-nwis.net Tag: XP Icon library Tag: 54792
Help: Exception using Threads and AxSHDocVw.AxWebBrowser
I have created an application that loads assemblies (plugins). These plugins
are windows forms that have an embedded browser.
private AxSHDocVw.AxWebBrowser browser;
If I comment out
this.browser = new AxSHDocVw.AxWebBrowser();
and associated code to avoid exceptions like
this.browser.Dock = System.Windows.Forms.DockStyle.Fill;
this.browser.Enabled = true;
from my plugin, then I don't get the exception.
I only receive the exception when using Threads. If I don't use threads then I don't
get the exceptions. The exception is generated --=> AFTER <=-- exiting main(). It
is NOT caught by the catch().
Any thoughts?
Dave
DavidElliott@BellSouth.net
=============================================================
EXCEPTION:
An unhandled exception of type 'System.NullReferenceException'
occurred in system.windows.forms.dll
Additional information: Object reference not set to an instance of an object.
==============================================================================
CODE
main()
{
try {
plugin = (IPlugIn)assembly.CreateInstance("AJB.Plugin");
plugin.PluginID = 74;
thr = new Thread( new ThreadStart(plugin.Execute) );
thr.ApartmentState = ApartmentState.STA;
thr.IsBackground = true;
thr.Start();
thr.Join();
}
catch (Exception e)
{
string s = Application.ExecutablePath.ToString() + "\n" + e.ToString() + e.Message + e.StackTrace;
MessageBox.Show(s, "ExecutePlugin() Error");
}
}
public void Execute()
{
InputForm ajbInputForm = new InputForm();
ajbInputForm.ShowDialog();
ajbInputForm.Close();
} Tag: XP Icon library Tag: 54791
Toolbar Floating / Docking
I have been unable to find any info on how to accomplish
toolbar floating & docking in C#.Net. Has this not been
implemented in .Net yet? I'm trying to model my
application usability (menu layout, features) based on
existing windows apps which to toolbar docking & floating.
Any help would be great
Thanks,
Glen Tag: XP Icon library Tag: 54790
Databound Combo - How to format date values
Im running win2k and .net 1.1 I have a combo who's rowsource is a dataview.
The data being used are date values and this is what it looks like in the
dataset thats used for this dataview: "2003-06-14T00:00:00.0000000-05:00"
And the dates in the combo's list looks like this: 6/14/2003 12:00:00 AM
How can i format the dates in the dropdown list to look like this:
6/14/2003
Thanks.
--
George Padvorac
georgep@dontspamme-nwis.net Tag: XP Icon library Tag: 54789
Specifying relative path for AxWebBrowser.Navigate
Hi,
I want past a relative path information to my AxWebBrowser.Navigate
method.
It should be something like AxWebBrowser1.Navigate("..\temp.html").
If relative path name cannot be specified, is there a way that I can
pass my application path to here?
Thank you
Gos Tag: XP Icon library Tag: 54787
Help & the HelpProvider -> Showing Topics???
I am trying to display a RoboHelp HLP file using .NET Help and the
HelpProvider. All of the commands display the help file, but none preselect
the Index or Seach tabs. Nor can I display a preselected topic. What is the
Keyword supposed to be set to?
Help.ShowHelp(this, helpFile);
Help.ShowHelpIndex(this, helpFile);
Help.ShowHelp(this, helpFile, HelpNavigator.Find);
Help.ShowHelp(this, helpFile, HelpNavigator.Topic, 8025);
WindowsAPI.WinHelp(this.Handle, helpFile,
(int)(HelpNavigator.AssociateIndex), 8025);
helpProvider.HelpNamespace = helpFile;
helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
helpProvider.SetHelpKeyword(this, "8030");
helpProvider.SetHelpString(this, "The Select Items window provides a central
location for report generation and watch window item selection.");
Anyhow, any working examples would be helpful. THANKS!
Steve Tag: XP Icon library Tag: 54784
Exception blocked in Application.Run()
Hi,
I have a very strange strange problem. All the exception that are thrown in
my Windows Forms do not thrigger the display of the traditional exception
dialog box that is usually shown. Instead, it seems that the Application
class, or any other class that manage the unhandled exception in Windows
Forms, catch it and silently continue program execution.
Three questions:
1) Is there anyone here that had the same problem?
2) How can it be corrected?
3) Am I missing a property or a setting somewhere?
Etienne Fortin Tag: XP Icon library Tag: 54777
How to make Win32 controls transparent?
Hi,
I found that checkbox, label and groupbox have
painting problem with their background. I create simple
frame with background picture and add checkbox, label and
groupbox on it. I set transparent background on controls
to see whole picture. Yes, it works. But, if I set
controls style to System (to get correct XP Visual Style):
checkbox and label background lost transparency!!!
groupbox doesn't repaint background (group box is like
window throw the frame)
So, I think that these three controls in not implemented
correctly in .NET. So I start to implement my own Win32
controls. I create the "static" control (label is based
on it). But the problem is the same: "static" control is
not transparent.
So, question is: "How to make Win32 controls transparent?"
I think, that it could be done successfuly, because
checkbox and radiobutton is the same Win32 class, and
radiobutton is painted correctly, but checkbox is not.
Thanks for any advice.
Leo Tag: XP Icon library Tag: 54776
How to Insert Header and Footers into Richtextbox
Hello everyone
I was wondering if someone could help me with a eazy way to add header and
footers to a richtextbox.
I am generating a report into the box and whant to see how it looks with the
Headers and footers.
Regards
Gretar Tag: XP Icon library Tag: 54774
How can I do this?
Hello,
I am using a AxWebBrowser control in a VB.net windows
form. In the form, I also have a TextBox where the user
enters the URL he would like to navigate to.
I want the TextBox to change it's display (to reflect the
new page address) when the user clicks on an hyperlink on
the web page (like in Internet Explorer). I have been
looking at the events and methods of the AxWebBrowser
object, and I can't find it!
Any help on this would be very appreciated.
thanks,
Ross
. Tag: XP Icon library Tag: 54773
Shared properties across instances
I have a console app running that references an Class Library.
The console app runs fine, but I want to be able to run a windows form
that will let me poll properties of the Class and reset them.
As my console is running, it checks these properties, if one of the
properties gets set, then my console app knows that it is supposed to
do something, like shut down.
I have setup a Shared property in my class:
Private Shared sTest As Integer
Public Shared Property Test() As Integer
Get
Return sTest
End Get
Set(ByVal Value As Integer)
sTest = Value
End Set
End Property
As I understood it, Shared properties are available to all INSTANCES
of a class. Granted that the Windows form is probably a different
process than the Console...is there anyway to create a truley shared
property across all instances in all processes? IS there another way
to do this?
My console App is running through records in a DB, so I could just
update the record it is working on, but that would be tedious since it
would require me to poll the DB way to often.
Any help would be appreciated or clues on another way to do this... Tag: XP Icon library Tag: 54771
Hi,
Does anyone know a link where I can find a modern-looking
icon and thumbnail library suitable for business
applications?
"Houssam Zeina" <houssam@orange-2000.com> wrote in message
news:062101c3695b$dc832af0$a601280a@phx.gbl...
> Hi,
>
> Does anyone know a link where I can find a modern-looking
> icon and thumbnail library suitable for business
> applications?
"Houssam Zeina" <houssam@orange-2000.com> wrote in message
news:062101c3695b$dc832af0$a601280a@phx.gbl...
> Hi,
>
> Does anyone know a link where I can find a modern-looking
> icon and thumbnail library suitable for business
> applications?