Dialogs Missing text
VB.NET winform appliation.
I created a simple application and it works fine on my machine, but on a
customer's it works, but message boxes have no prompt text or button text.
Any ideas ? Tag: Master/detail form in vs2005 Tag: 87146
HtmlEncode not working properly
Hi, i'm trying to use HttpUtility.HtmlEncode(string) from System.Web
inside a dll called from VB6. Locally it works fine, but when i deploy
it in my test enviroment the function always returns the string as it
arrives.
Am i doing anything wrong? do i have set anything up in my test
server? Tag: Master/detail form in vs2005 Tag: 87143
What's the main difference between Application.Exit() and Application.ExitThread()?
Hi
Can anyone tell me the difference between ¡yApplication.Exit()¡z and
¡yApplication.ExitThread()¡z?
I'm confused by the MSDN's explanation....
I'v try some codings but find nothing different between two of them!
Can someone give me explames?
Thanks! Tag: Master/detail form in vs2005 Tag: 87142
Controlled scroll of Internet Explorer window via windows form
Hi every1,
I searched a while for this but found nothing usable honestly.
What I would like to do is the following:
I use a windows form application to generate an html page. Now my question:
Is it possible to scroll the Internet Explorer page timed by my windows app?
On this html page I have certain timings and I would like to scroll when a
certain time is passed...
Can somebody point me in the right direction?
Thanks beforehand.
Greets,
Tom. Tag: Master/detail form in vs2005 Tag: 87139
Has the EnableVisualStyles bug hit me?
Hello All,
I have a .NET application running on Windows XP. I have quite a few forms,
some modal and some modeless. Once in a while we get a wierd exception in
the application and most of the time the code is transferred to the top
level 'ThreadExceptionEventHandler'. It is difficult to get the information
on actual exception. Most of the time it seems to say "External component
has thrown an exception' and the source of the exception object is 'System'
Doing a bit of searching on the internet, I came across the known bug in
EnableVisualStyles( ). I do not call the Application.EnableVisualStyles at
all. but I do call Application.DoEvents (this was suggested as a fix
somewhere) I tried looking for the comctl32.dll. In the System32 folder the
dll has version 5.82. One of the articles on the internet said, XP uses 6.0
by default. Where would this dll be?
I do get rounded corners for my form's title bar, does this mean that my
application is using visual style? If yes where is it getting set? Is it the
default under Windows XP (SP2)?
Can somebody direct me to information which will lead to better
understanding of visual styles and the related bug. I don't even know
whether what I am facing is the same bug or not
TIA,
--Saurabh Tag: Master/detail form in vs2005 Tag: 87136
Displaying a regular windows app inside a control window
What I am trying to do is launch a windows application from within my
WinForms application. Once this is done I want to have this external
application behave like a control on my WinForms app (no longer
appears in status bar, no frame etc.).
I remember seeing a Code Project article describing how to do this,
but hours of googling for it has not turned up anything. Does anyone
reading this remember the article?
While I can launch an application using System.Diagnostics, find a
windows handle using an API call I wouldn't have a clue how to modify
it. Does anyone know how I could go about modifying the application?
I would really appreciate any help and I am sure I won't be the only
person who would benefit from this knowledge.
regards,
Rick Tag: Master/detail form in vs2005 Tag: 87135
tooltips for combobox ?
I have looked in every nook and cranny and I could not find any answer.
How do I implement tooltips in a combobox (while the combobox is expanded) ?
I want to have a tooltip for each item in the combobox. I know how to make
it work for a listbox, but not for a combobox.
So when you expand a combobox and start browsing the items, I want a tooltip
to appear for each item.
Someone please help!
P.S. (I cross posted to C# as well)
Thanks Tag: Master/detail form in vs2005 Tag: 87124
Double buffer a form
Is there some trick to double buffer a whole form without having to subclass
every single control on it to make each control double buffered?
I've noticed that when I resize my form the controls on it starts flicking
so much it's not even funny.
I thought I could be clever and do something like this
foreach(Control c in this.Controls){
// Set the value of the double-buffering style bits to true.
c.SetStyle(ControlStyles.DoubleBuffer, true);
}
but that won't work since the SetStyle method is declared as protected in
Control. (Why is it declared protected?)
Martin Tag: Master/detail form in vs2005 Tag: 87123
Goddamn Bug:ListView Updating Too Slow When Done Through Other Cla
Please help us!
We wasted a couple of days debugging a slow list view control in .NET
and we realized that if you try to update the listview's listitems from a
class other than the form on which the listview is placed, it will get REAL
slow!
This seems to be a bug which we hope to be fixed in later versions of .NET
framework, but for now, we need a workaround quickly.
Any comments?
Thanx in advance. Tag: Master/detail form in vs2005 Tag: 87119
richtextbox
i got mdichild working. i am using withevents procedure. the message is
not getting through richtextbox. but i can see debug window .
here is code:
class1.vb:
Public Sub New(ByVal mParent As mainPirateChat)
m_parent = mParent
_Connection = New ConnectionFactory
nStatus = New frmStatus
nStatus.MdiParent = m_parent
nStatus.Show()
End Sub
Public Sub New(ByVal mparent As mainPirateChat, ByVal szChannel
As String)
szTag = szChannel
m_parent = mparent
Me.NewChannel(m_parent, szChannel)
End Sub
Delegate Sub OneArgSub(ByVal rtb As RichTextBox, ByVal szText As
String, ByVal szColour As String, ByVal szNum As Integer)
Public deleg As OneArgSub
Private Sub _Connection_onChanMsg(ByVal szNick As String, ByVal
szChannel As String, ByVal szText As String) Handles _Connection.onChanMsg
nChan = New frmChannel
deleg = New OneArgSub(AddressOf DisplayMessage)
deleg.Invoke(nChan.rtbChannel, "<" & szNick & "> " &
szText.ToString(), GetUserColours.colourChat, 11)
Debug.WriteLine("M :" & szText)
End Sub
Private Sub _Connection_onNickJoin(ByVal szNick As String, ByVal szHost
As String, ByVal szChannel As String) Handles _Connection.onNickJoin
Debug.WriteLine("joined :" & szTag & " " & szNick & " " &
szHost & " " & szChannel)
nChan = New frmChannel
nChan.Text = szTag
nChan.lstNames.Items.Add(szNick)
nChan.Text = szTag.ToLower & " [" &
nChan.lstNames.Items.Count & "]"
If szNick <> _Connection.Nick Then
deleg = New OneArgSub(AddressOf DisplayMessage)
deleg.Invoke(nChan.rtbChannel, "<" & szNick & "> " & "["
& szHost & "] " & " has joined " & szChannel.ToString(),
GetUserColours.colourJoin, 1)
End If
End Sub
u can see in debug.writerline:
M :looooooooooool
ExTriaL!ExTriaL@163.121.174.87 PRIVMSG #usa :looooooooooool
joined :#usa diana-- !~buttafly@203.175.254.38 #usa
diana--!~buttafly@203.175.254.38 JOIN :#usa
why is that not getting tru richtextbox.
regards, Tag: Master/detail form in vs2005 Tag: 87118
C# namespace for SQLServer connection dialog et al.
Are there any C# namespaces that encapsulate the "Connect to SQL Server"
dialog that appears when you launch the Query Analyzer? I would also be
interested in dialogs to select the current database. If they do not already
exist, how do I retrieve the data that is necessary to create such a dialog
myself?
Thanks in advance,
Brian Hough Tag: Master/detail form in vs2005 Tag: 87117
Maximising window using shortcut
I created a windows form (using J#), set the BorderStyle to FixedDialog, and
disabled the maximise box. All I wanted was that the user should not be able
to change the size of the window. After my application was built, I created a
shortcut to it. In the shortcut properties, I set the Run: property to
"Maximised" from "Normal Window". When I started the application from the
shortcut, it was maximised. I could neither resize the window, nor "restore"
it (as expected).
I think this behavior needs to be looked into. I feel that if an
application's maximise button is disabled, then the shortcut should'nt be
able to show the form as maximised.
--
Sushovan, a crazy junior Tag: Master/detail form in vs2005 Tag: 87116
DataSource Property and Thread Safety
What happens if the object referenced by the DataSource property in a ListBox
is updated by another thread? Is ListBox smart enough to check InvokeRequired
before updating the GUI based on the change? IList doesn't publish any
events, so it's not clear how the changes to the IList are being detected
under the covers. Tag: Master/detail form in vs2005 Tag: 87109
GUI issues in MDI application
Hi ,
Please help me with the following issues as soon as possible. Thanks in
advance for all of the timely help.
I have a MDI windows application made in VC#. It has 3 child forms and each
form contains 4 panels each. Besides this I have a login form which is not
the MDI children . At run time the application start with a class (which
ensures that there is only one instance of application), then control comes
to login form and then comes to MDI parent form.
I have some doubts and problems with GUI.
1. I am not able to disable the ControlBox of the MDI Children forms. I have
set the following properties for all of the MDI child forms...
ControlBox=False;
MinimizeBox = False;
MaximizeBox = False;
I searched for the issue and found it as a big bug in DotNet on the
following link ...
http://www.dotnet247.com/247reference/msgs/33/169116.aspx
Unable to remove the control box is messing up my application.
2. I read somewhere that if you don't set the project's starting object(at
runtime) as MDI parent form, then MDI applications in DotNet create
problems. Is it true ?
3. I have some common panel and functionlity. Right now that common panel
has been replicated on each of the form. What is the best way to use these
common panel and where to put the functionality.
4. How to change the the background colour of MDI Parent form. Right now I
am using the following article but it is not changing the background
colour of my form. The link is ...
http://support.microsoft.com/kb/319465/EN-US/
5. A strange issue .. Whenever I minimize the MDI parent form and restore
it.back, the panels relocates in down direction. Each time I minimize it
and restores back , it keep on moving in the downward
direction.
I don't have extensive experience of working in C#. Please forgive me
if the issues seems to be silly and guide me.
Thanking you,
Rajat Tandon.
A DotNet Learner. Tag: Master/detail form in vs2005 Tag: 87108
ToolTip : Setting the pop-up location.
With the [ToolTip] control - I'm wondering if there is a way to explicitly
set the location that it pops up. From it's ref docs I can't see a way to
set a location - and I'm wanting to have different tool-tips popup based on
mouse activity within the bounds of a single control.
Is this possible - or is there perhaps another control that can be used for
pop-up tooltips?
Many thanks everyone.
===
Phil Tag: Master/detail form in vs2005 Tag: 87107
Embedding a form into a panel control
I am embedding a form into a panel control using pnl.Controls.Add(form);
This works pretty well, however there is one problem.
The panel can resize, so there are cases when the panel size is smaller than
the form embeded in it. The framework handles this problem by showing only a
piece of the form that fits in the panel. Is there a way to add scroll bars
to the panel so that the user can view the entire embedded form without
resizing the panel?
Is there any piece of code that handles this whole situation?
Thank you
Cezar Mart Tag: Master/detail form in vs2005 Tag: 87104
Ad Rotator Windows Form
I have a windows form app that has a web browser control on it. The browser
control will rotate ads in and out. These ads are to be loaded on the local
machine? I know asp.net has a rotator control, but windows forms do not.
Any suggestions on this?
Mark Tag: Master/detail form in vs2005 Tag: 87099
DataGrid: Custom combo box column question
Hi,
I have made my custom combo box column based on several articles
(http://msdn.microsoft.com/smartclient/community/wffaq/ctrlsp.aspx & other
articles).
I derived the custom column from DataGridTextBoxColumn, and show a combobox
when editing a cell's entry. The problem is that when I press <enter> or
<return>, the focus stays inside the cell. What should I do to have the
default behaviour (move to the cell on the next row)?
Thanks,
--
Tom Tempelaere. Tag: Master/detail form in vs2005 Tag: 87097
Calling Web Services from a Web Form throws CAS violation
We created a C# Windows forms application and put the .EXE on our web server.
We can download the executable from the web server to a desktop and it will
display OK. When we click a button that causes the executable to call a web
service on the same web server, we get the following code access security
violation.
-------------- begin violation -------------------------------------------
Could not talk to the web server. Error = 'System.InvalidOperationException:
There is an error in XML document (1, 269). --->
System.Security.SecurityException: Security error.
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read2_ReturnDS(Boolean isNullable, Boolean checkType)
at
Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read9_StorlibReadResponse()
The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Security.Permissions.FileDialogPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"/>
<IPermission
class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Allowed="None"/>
<IPermission class="System.Security.Permissions.SecurityPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Execution"/>
<IPermission class="System.Security.Permissions.UIPermission, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Window="SafeTopLevelWindows"/>
<IPermission class="System.Net.DnsPermission, System, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"/>
<IPermission class="System.Drawing.Printing.PrintingPermission,
System.Drawing, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
version="1"
Level="NoPrinting"/>
<IPermission class="System.Diagnostics.PerformanceCounterPermission,
System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"/>
<IPermission class="System.Security.Permissions.UrlIdentityPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Url="file://C:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll"/>
<IPermission class="System.Security.Permissions.ZoneIdentityPermission,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
version="1"
Zone="MyComputer"/>
</PermissionSet>
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader, String encodingStyle)
at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
at
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at BackIssue.com.kcc.cad.Service.StorlibRead(String wildcard)
at BackIssue.FormMain.searchForWildcard()'
---------------- end violation -------------------------------------------
What do I need to do to get past this violation?
Joe Tag: Master/detail form in vs2005 Tag: 87094
TABLE
Hi,
my code is:
DataTable dt = myDataSet.Tables[0];
newDataSet.Tables.Add(dt);
This code generate an error... "tha table dt already belongs to a dataset"...
is there a solution to this problem? namely, I would like to reach this
aim... is there another solution code?
Thanks Tag: Master/detail form in vs2005 Tag: 87091
General Informations about winforms
I am searching for informations related to the creation of apps using winforms : i have to create a very nice appearance like the classic winamp or qcd.
any links to tuto, guide, samples, or advices would be helpful !
Thanks.
**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources... Tag: Master/detail form in vs2005 Tag: 87088
CREATE A DATASET
Hi,
I would like to add three table to a DataSet: these three tables have tha
same structure (columns name and type) but contains different records.
When I try to add them, at the second table, I receive an error: "This table
belongs already to another DataSet"
Could you please help me to solve the problem Tag: Master/detail form in vs2005 Tag: 87087
Build a DataSet
Hi,
in my SQL Server Database I've a table named Customer with the following
column:
CustomerID: primary key
CompanyName: name of the customer
Type: customer can be of type ROOT, BRANCH, COST_CENTER
OwnerID: the key number (CustomerID) to which the customer belongs
This table contains 3 types of customer: ROOT, BRANCH and COST_CENTER.
A ROOT can have many Branches and Cost_Centers
A Branch can have many Cost_Centers.
The column OwnerID allows to identify to which that customer belongs: if the
customer is a ROOT, this column has the same number of CustomerID.
My question is: how can I create a DataSet with three table in relation,
namely:
ROOT, BRANCH and COST_CENTER relationed with column CustomerID and OwnerID
The three table should show the tree like this:
ROOT with its BRANCHES and COST_CENTERS
for each BRANCHES its COCST_CENTERS
Is it a problem if the table have the same structure for the three new?
Thank you. Tag: Master/detail form in vs2005 Tag: 87085
Adjust scrollbarvalue of TreeView
Hi,
I have 2 TreeViews. When i scroll one of them the other one must scroll
also, so there are synchronized.
Does somebody knows how to read out the scrollbar value of a TreeView and
how to put a new value in?
Thanx Tag: Master/detail form in vs2005 Tag: 87082
Dutch User Group Conference, International Speakers!!!
Please check this out:
Software developers conference may 30-31th may Papendal/Arnhem The
Netherlands
90 session covering C#, VB.NET, ASP.NET, Delphi 32 and Delphi.NET
www.sdc.nl
Software Developer Network www.sdn.nl
The Software Developer Network is usergroup run by software developers for
software developers. The goal of the Software Developer Network is to
further the knowledge of its members and to form a network of developers.
The SDN counts a total of 2000 developers.
regards,
Erik Visser Tag: Master/detail form in vs2005 Tag: 87081
Currently position my windows form
Hi
How can i set Currently position of my window form.
for example:
x = this.Location.X;
y = this.Location.Y;
//(x=199, y =200);
//i want to set my windows form in x(10,20)????
Thanks!! Tag: Master/detail form in vs2005 Tag: 87079
howto create a simple boundable property
I want to create a usercontrol usable in a winform.
This usercontrol has some textbox and 1 simple property called MyValue. It's
code is :
private int myValue;
public int MyValue{
get{ return myValue; }
set{ myValue = value; }
}
I want to bind my Textbox and this property to dataset columns. Unfortunatly
MyValue property cause adding new row in the dataset to fail. (BindingContext
never position to the added row).
My question: Is there anything to do to make this simple property bindable ?
Thanks for any help. Tag: Master/detail form in vs2005 Tag: 87078
DataGrid: Update datasource when closing form
Hi,
The situation is the following: A user is editing a cell in a DataGrid, and
hasn't pressed <return> or <enter>, so the value is being edited. The user
then closes the form. I would like to update the value to the data source if
it is valid, or prevent closing the form if the edited value is invalid.
Actually, all I need for this to accomplish are the following two functions:
(1) A function that tells me whether or not the user is actually editing a
cell's contents.
(2) A function that tries to end the edit operation, and returns whether
ending the operation succeeded. Ending the edit operation should fail if the
value being edited is invalid (not valid).
I haven't found these yet.
About (1): I've checked DataRowView's IsEdit member, but I tested it and it
seems to return true even if a user isn't editing a cell in that row.
About (2) DataGrid has an EditEdit method. Sadly it returns false when no
cell is being edited, so I can't make the distinction between an invalid
entry or the fact that the cell isn't being edited. So using (2) alone
doesn't work.
Thanks for any help
--
Tom Tempelaere. Tag: Master/detail form in vs2005 Tag: 87076
ActiveX controls causing multiple calls to UserControl's OnLoad
If I host ActiveX controls on a UserControl, the designer inserts calls
to the controls' EndInit methods into the UserControl's
InitializeComponent method. Every time EndInit is called (once for
each ActiveX control), the containing UserControl's OnLoad method is
called.
Is this by design? If so, how am I supposed to deal with it?
If I host the same controls on a Form, the Form's OnLoad is only called
once, even though EndInit is called for each control.
I posted about this a few days ago; still puzzling over it.
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.windowsforms/messages/3e6859dfbd8a4ecb,e2b3a9fdc23b41ec,73c8eafc4da4abb9?thread_id=8fcf88093bfceaf6&mode=thread&noheader=1&q=OnLoad+UserControl#doc_3e6859dfbd8a4ecb Tag: Master/detail form in vs2005 Tag: 87069
major challenge : strange problem with drag&drop of Outlook2003 msg to vb.net form
Hi,
I'm desperatly trying to find how I can use drag and drop for an
Outlook 2003 msg towards a VB.Net Windows application. Normally you
should use
Dim theSteam As Stream = CType(e.Data.GetData("FileGroupDescriptor",
True), Stream)
to capture the filename (which works great) and use
Dim ms As MemoryStream = CType(e.Data.GetData("FileContents", True),
MemoryStream)
which returns nothing.
The strange thing is that e.Data.GetDataPresent("FileContents") returns
true.
I also tried to copy an msg file to the clipboard and tried to download
the message from the clipboard into my vb.net application but same
behaviour. I also tested the same thing in c# but no changes. Can
someone please advice what's wrong ? Is this a bug gentlemen from
Microsoft ???
Thx for some feedback !!! Tag: Master/detail form in vs2005 Tag: 87068
NUnit, NMock and DataBinding
Hi all,
Can anyone share their experiences (at a high level) mocking a database that
fills a Dataset that is bound to controls in a UI? I'm finding the task
rather daunting.
Cheers,
WNC Tag: Master/detail form in vs2005 Tag: 87063
databinding issue
Hi,
I've got the following problem with databinding:
If I bind a column of a dataset e.g. on the Text property of a Textbox,
everything acts as expected, i.e. if you don't make any changes to the text
in the textbox, the rowstate of the bound row stays unchanged.
On the contrary, when you bind e.g. the Tag property of the Textbox, instead
of the text property, the rowstate turns to modified when leaving the
textbox (or by calling the bindingmanager.endcurrentedit method), even if
you haven't changed a thing.
This is very inconveniant because it causes unnecessary updates of the
database.
It seems that binding on the non default property (which is Text) causes
changes of
the underlying dataset.
I assume it has somtehing to do with adding attributes to the properties ?
or not ?
How can we avoid this ???
Thanks !!! Tag: Master/detail form in vs2005 Tag: 87062
How to close a form in C#
I'm trying to close a form in C#. I have a vb background, so the question
may sound dumb. In vb it is just me.close(). I've tried a bunch of ways to
close the form but C# is acting pretty dumb also. I can't find a way to
close it. Here are some of the things I've tried:
private void button1_Click(object sender, System.EventArgs e)
{
// Form1 frmI = new Form1();
// DialogResult dr = frmI.ShowDialog();
Form1.Quit();
// this.Hide();
}
The new form seems to recreate the form - that is a total nightmare. Hide
doesn't end the program and Close just gets a message that says close is not
defined.
--
Regards,
Jamie Tag: Master/detail form in vs2005 Tag: 87049
Several bugs and workarounds
In the course of writing my application, I have come across several =
issues that seem to be Microsoft bugs.
Following is a summary and possible workarounds.
Jeffrey Tan, if you are reading this, please verify.
Also, I'd like to know how to request fixes for these issues.
1) Sometimes the designer decides to spontaneously rearrange the tabs in =
a TabControl.
Status: Verified "known issue" - "Tab control TabPage order is =
randomized"
Workaround #1, suggested by Herfried K. Wagner
Make sure you have always the first tab selected when recompiling
Workaround #2: Delete and recreate the tabs after the call to =
InitializeComponent()
// Sample
pages =3D new TabPage[] { pageOne, pageTwo, pageThree, pageFour, =
pageFive };
myTabControl.Controls.Clear();
myTabControl.Controls.AddRange(pages);
2) BeginUpdate/EndUpdate does not work correctly when adding a single =
item to a sorted ListBox
Status: Verified "known issue"
Workaround #1: Check the number of items to update and only perform =
BeginUpdate/EndUpdate if >1.
if (items.Count > 1)
myList.BeginUpdate();
myList.Items.AddRange(items);
if (items.Count > 1)
myList.EndUpdate();
Workaround #2: Toggle the Sorted property.
// Sample
myList.BeginUpdate();
bool bug_workaround =3D myList.Sorted;
myList.Sorted =3D false;
myList.Items.AddRange(items);
myList.Sorted =3D bug_workaround;
myList.EndUpdate();
3) A DataGrid leaves text on the screen after deleting a row containing =
a selected (highlighted) cell.
Happens when the columns are set to read-only, mostly visible when =
deleting the last row.
Status: Verified "known issue"
Workaround: Set the read-only property of the whole DataGrid to true and =
the read-only properties
of the individual DataGridTextBoxColumn items to false.
Don't know about cases when only some columns need to be read-only.
4) A DataGrid on a TabPage loses the data binding if the is deleted from =
the TabControl.
Since the only way to hide tab pages is to remove them, it is relevant.
Status: Happens on my machine...
Workaround: un-bind and re-bind the DataGrid when removing & re-adding =
the tab page.
Those are the bugs that I encountered.
If you know of more, please post.
--=20
Address email to user "response" at domain "alexoren" with suffix "com" Tag: Master/detail form in vs2005 Tag: 87044
ANN: Dialog Workshop .NET 1.4.1 released
Hello,
Dialog Workshop .NET ver. 1.4.1 released!
Using Dialog Workshop components you can speed up the creation of
customized standard dialogs (based on the Windows Common dialogs) in
your .NET applications without using WinAPI and resource editors!
Many really powerful features are available:
- extend your dialogs using your WinForms without writing a line of
code;
- custom dialog items captions;
- customized dialog startup position;
- custom file list view styles, etc. in Open/Save dialogs;
- OpenFile dialog with MRU files tab;
- design-time support, etc.
Also Dialog Workshop for VCL.NET (Delphi.NET) is available now.
Please visit our homepage for details:
http://www.componentage.com
Sergey Novogilov
COMPONENTAGE Software
http://www.componentage.com Tag: Master/detail form in vs2005 Tag: 87039
Creating a scrollable container control
I would like to create a custom container control which can scroll its
child controls. I know that the AutoScroll property of
ScrollableControl can mimic this functionality, but AutoScroll causes
some behavior which is EXTREMELY obnoxious to my users, and I haven't
been able to find a workaround.
Consequently, I would like to be able to scroll a control without using
the AutoScroll property.
Is there any way to accomplish this? I've created the appropriate
scrollbars, and now I just need to get the child controls to move. The
SetDisplayRectLocation() function sounded like exactly what I needed,
but it doesn't seem to work unless AutoScroll is enabled. Tag: Master/detail form in vs2005 Tag: 87033
Windows Form in Shared Add-in not reading App.config settings
Good Morning,
I am developing an Outlook Shared Add-in using VB.Net. A Windows form has
been added to the project, but is not reading the values in the app.config
file during testing. The code (Sub Main) is below and displays "Blank
connection string" is the label. It is called by an Outlook command button
click event:
Private Sub btnCTXNotesHistory_Click(ByVal Ctrl As
Microsoft.Office.Core.CommandBarButton, ByRef CancelDefault As Boolean)
Handles btnCTXNotesHistory.Click
Dim frmNotesHistory As New frmCTXNotesHistory
frmNotesHistory.Main()
frmNotesHistory.Show()
End Sub
Sub Main()
Dim sqlconCTXControl As New SqlClient.SqlConnection
sqlconCTXControl.ConnectionString =
ConfigurationSettings.AppSettings("sqlconCTXControl.ConnectionString")
lblErrorMsg.Text = sqlconCTXControl.ConnectionString.ToString
If lblErrorMsg.Text.Length = 0 Then
lblErrorMsg.Text = "Blank connection string"
End If
End Sub
Thanks. Tag: Master/detail form in vs2005 Tag: 87031
InvalidCastException: (DataSet) DataGrid.DataSource
I need some help please.
Say you have a DataGrid and a DataSet, and you create a dataview to handle
sorting and filtering and then you assign the dataview to
DataGrid.DataSource. Once you did that you will get InvalidCastException if
you do this:
DataSet dataSet = (DataSet) dataGrid.DataSource;
But I need to do that because I need to get the DataGrid's dataentries in a
dataset and use XmlDataDocument to load the dataset and then write it to an
xml file.
Maybe my first design decision to assign dataview to the datasource should
be reviewed. I don't know. Any comment will really help.
Thank you. Tag: Master/detail form in vs2005 Tag: 87030
Transparent UserControl
I'm going Mad!
Has anyone been able to give a UserControl a transparent Background
I've tried...
this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = Color.Transparent;
this.UpdateStyles();
... but it does not work. Tag: Master/detail form in vs2005 Tag: 87027
Changing grid cells programatically
I have a DataGrid and I'm changing the value in one of the cells
programatically.
Problem is, my change isn't being picked up (and saved in the underlying
data source), unless I manually tab off the cell in the grid.
I've tried calling BeginEdit and EndEdit around the code that populates the
cell, to no avail.
What am I missing? Tag: Master/detail form in vs2005 Tag: 87023
TLSStream object problem
I have an application that needs to send a HttpWebRequest to a secure server
via https on a non-standard SSL port, I need to use port 5004. The error I
get an the stack is shown below. The code works fine using the standard SSL
port, but fails using port 5004, not a firewall issue.
ERROR: Cannot access a disposed object named "System.Net.TlsStream".
Object name: "System.Net.TlsStream".
at System.Net.TlsStream.InnerWrite(Boolean async, Byte[] buffer, Int32
offset, Int32 size, AsyncCallback asyncCallback, Object asyncState)
at System.Net.TlsStream.BeginWrite(Byte[] buffer, Int32 offset, Int32
size, AsyncCallback asyncCallback, Object asyncState)
at System.Net.Connection.BeginWrite(Byte[] buffer, Int32 offset, Int32
size, AsyncCallback callback, Object state)
at System.Net.ConnectStream.BeginWrite(Byte[] buffer, Int32 offset, Int32
size, AsyncCallback callback, Object state)
at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
Code:
Errors out on the Poststream.Write line of code.
Is there any way to Overload the webrequest object to force it to see the
certificate.
In debugging I am apply to query the certificate object and have not problem
viewing its properties.
Any and all help would be greatly appreciated.
Thanks.
Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnTest.Click
Dim TransactionString As String = ""
Dim Response As String = ""
Dim VitalUri As New Uri("https://ssltest.tnsi.com:5004/")
Dim RequestUri As New Uri(VitalUri, "test.php")
Dim WRequest As HttpWebRequest
'For quick Connectivity Test use this abbreviated test record
TransactionString = "D4.999995" & Chr(3)
Dim LRC As String = LongitudinalRedundancyCheck(TransactionString)
'Dim htmlrequest As New HTMLRequest
'Response = htmlrequest.getRequest(requestUri, Chr(2) & TransactionString
& LRC, "x-Visa-II/x-auth")
Try
ServicePointManager.CertificatePolicy = New TrustAllCertificatePolicy
WRequest = CType(WebRequest.Create(RequestUri), HttpWebRequest)
WRequest.Method = "POST"
WRequest.ContentType = "x-Visa-II/x-auth"
WRequest.ContentLength = TransactionString.Length + 2
'convert the transaction string to a Stream object
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(Chr(2) &
TransactionString & LRC)
Dim Poststream As Stream = WRequest.GetRequestStream
Dim bob As String = WRequest.ServicePoint.Certificate.GetRawCertDataString
Poststream.Write(byteArray, 0, TransactionString.Length + 2)
Poststream.Close()
'assign the response object of WRequest to a WebResponse variable
Dim WResponse As WebResponse = WRequest.GetResponse
Dim ResponseStream As Stream = WResponse.GetResponseStream
Dim StreamReader As New StreamReader(ResponseStream)
Response = StreamReader.ReadToEnd
ResponseStream.Close()
StreamReader.Close()
WResponse.Close()
Catch ex As Exception
Response = "ERROR: " & ex.Message & vbNewLine & ex.StackTrace
End Try
Me.txtResponse.Text = Response
End Sub
Private Function LongitudinalRedundancyCheck(ByVal Message As String) As
String
Dim sLRC As String = ""
Dim iXor As Integer = 0
Dim Value1 As Integer = 0
Dim Value2 As Integer = 0
Dim Position As Integer = 0
Try
If Message.Length >= 2 Then
Value1 = Asc(Message.Substring(0, 1))
Value2 = Asc(Message.Substring(1, 1))
iXor = Value1 Xor Value2
Position = 1
Do While Position < Message.Length - 1
Position = Position + 1
Value1 = iXor
Value2 = Asc(Message.Substring(Position, 1))
iXor = Value1 Xor Value2
Loop
sLRC = Chr(iXor)
Else
sLRC = Message
End If
Catch ex As Exception
sLRC = ""
End Try
Return sLRC
End Function
End Class
Public Class TrustAllCertificatePolicy
Implements System.Net.ICertificatePolicy
Public Function CheckValidationResult(ByVal srvPoint As
System.Net.ServicePoint, ByVal certificate As
System.Security.Cryptography.X509Certificates.X509Certificate, ByVal request
As System.Net.WebRequest, ByVal certificateProblem As Integer) As Boolean
Implements System.Net.ICertificatePolicy.CheckValidationResult
Return True
End Function
End Class
Public Class RequestState
Public request As HttpWebRequest
Public requestDocument As String
Public Sub New()
request = Nothing
requestDocument = ""
End Sub
End Class
Public Class HTMLRequest
'Handler to synchronize with main thread
Private allDone As New ManualResetEvent(False)
Private _requestDocument As String
Private _responseDocument As String
Private _web As HttpWebRequest
Private Sub ReadCallback(ByVal asynchronousResult As IAsyncResult)
Dim result As String = ""
Try
'get the information to pass on from the Async Object
Dim myRequestState As RequestState = CType(asynchronousResult.AsyncState,
RequestState)
Dim myWebRequest2 As HttpWebRequest = CType(myRequestState.request,
HttpWebRequest)
Dim requestDocument As String = myRequestState.requestDocument
'get the stream to write the request to
Dim streamResponse As Stream =
myWebRequest2.EndGetRequestStream(asynchronousResult)
Dim bytArray() As Byte =
System.Text.Encoding.ASCII.GetBytes(requestDocument)
streamResponse.Write(bytArray, 0, requestDocument.Length)
streamResponse.Close()
'tell the main thread that writing stream is complete
allDone.Set()
Catch e As WebException
result = e.Message
Catch ex As Exception
result = "Error: " & ex.Message
allDone.Set()
End Try
End Sub
Private Sub retrieve()
Try
Dim objWebResponse As WebResponse = _web.GetResponse
Dim objStream As StreamReader
objStream = New StreamReader(objWebResponse.GetResponseStream,
System.Text.ASCIIEncoding.ASCII)
_responseDocument = objStream.ReadToEnd
'close the objects
objWebResponse.Close()
objStream.Close()
Catch ex As Exception
_responseDocument = "ERROR retrieve: " & ex.Message
End Try
End Sub
Private Sub send()
Try
'Prepare objects to pass int async call
Dim myRequestState As New RequestState
myRequestState.request = _web
myRequestState.requestDocument = _requestDocument
Dim r As IAsyncResult = CType(_web.BeginGetRequestStream(AddressOf
ReadCallback, myRequestState), IAsyncResult)
'wait till asychro is done
allDone.WaitOne()
Catch ex As Exception
End Try
End Sub
Public Function getRequest(ByVal requestUri As Uri, ByVal requestText As
String, ByVal sContentType As String) As String
ServicePointManager.CertificatePolicy = New TrustAllCertificatePolicy
_requestDocument = requestText
_web = CType(WebRequest.Create(requestUri), HttpWebRequest)
With _web
.ContentType = sContentType
.Method = "POST"
.KeepAlive = False
.ContentLength = requestText.Length
.Timeout = 10000
End With
Try
send()
retrieve()
Return _responseDocument
Catch ex As Exception
Return "ERROR getRequest: " & ex.Message
End Try
End Function
End Class Tag: Master/detail form in vs2005 Tag: 87022
DataGrid: Custom ComboBox column problem
Hay there,
I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one
(I hope .NET 2.0 supplies one). I based it on this article:
http://msdn.microsoft.com/msdnmag/issues/03/08/DataGrids/default.aspx
I have a problem when there are two DataGrid's on one form, and when I
switch focus from one grid to the other. To be more precise, when I'm editing
a combo box column in one grid, and then click in the combo column of another
grid an exception is thrown stating "The ListManager's position must be equal
to rowNum.
Parameter name: rowNum".
I will post the code if anyone feels like digging into it. Anyway, perhaps
someone has a better link with a how-to?
Notes about the code:
* The only thing that the PropertyEditorTable is used for in this context is
for setting the DataSource of the ComboBox that edits the value.
* The exception occurs when executing SetColumnValueAtRow in the
comboBox_Leave event handler
internal class PropertyComboBoxColumn : DataGridTextBoxColumn
{
protected PropertyEditorTable pe;
private ComboBox comboBox;
private CurrencyManager cm;
private int iCurrentRow;
public ComboBox ComboBox {
get { return comboBox; }
}
public PropertyComboBoxColumn( PropertyEditorTable pe )
{
this.pe = pe;
this.cm = null;
this.comboBox = new ComboBox();
this.comboBox.DropDownStyle = ComboBoxStyle.DropDown;
this.comboBox.Leave += new EventHandler( comboBox_Leave );
}
protected override void Edit (
CurrencyManager source,
int rowNum,
Rectangle bounds,
bool readOnly,
string instantText,
bool cellIsVisible )
{
base.Edit( source, rowNum, bounds, readOnly, instantText, cellIsVisible );
if( !readOnly && cellIsVisible )
{
iCurrentRow = rowNum;
cm = source;
DataGridTableStyle.DataGrid.Scroll += new EventHandler( DataGrid_Scroll );
comboBox.Parent = TextBox.Parent;
comboBox.Location =
DataGridTableStyle.DataGrid.GetCurrentCellBounds().Location;
comboBox.Size = new Size( TextBox.Size.Width, comboBox.Size.Height );
pe.SetDataSourceForPropertyCombo( rowNum, source, comboBox );
int foundIndex = comboBox.FindStringExact( TextBox.Text );
if( foundIndex == -1 )
comboBox.Text = TextBox.Text;
else
comboBox.SelectedIndex = foundIndex;
comboBox.Show();
comboBox.BringToFront();
comboBox.Focus();
}
}
private void DataGrid_Scroll(object sender, EventArgs e)
{
comboBox.Hide();
}
private void comboBox_Leave( object sender, EventArgs e )
{
SetColumnValueAtRow( cm, iCurrentRow, comboBox.Text );
Invalidate();
comboBox.Hide();
DataGridTableStyle.DataGrid.Scroll -= new EventHandler( DataGrid_Scroll );
}
}
Thanks,
--
Tom Tempelaere Tag: Master/detail form in vs2005 Tag: 87018
Data Grid: Adding new Rows
Hi
There is a databound grid that is being used in one of my Master - Detail
form there I need to keep two columns hidden and assign Autogenerated values
once a user adds a new record through the grid. can somebody please tell me
how to do this; as i couldn't find a single event that is fired once a new
row is added to the grid; and also i have tried quite a bit of fruite less
methods like medling with the data source etc. can somebody please help me
on this.
thankx in advance Tag: Master/detail form in vs2005 Tag: 87010
Want to check condition before switching between child forms
In My MDI Application (One Mdi Parent and around 50 mdi child forms). On each
child form is a database driven form, it means user can add,update etc.
record in the database. i want to check certain condition before switching
between mdi child forms, if condition is true then user should be allowed to
move another mdi child form otherwise not.
Steps to duplicate.
1. Open first child form1
2. Open second child form2
3. Press add child form2
4. now user tries to move on form1, and i want to validate (if operation is
complete : Want to complete) if yes then focus should not be moved to form1
else it should be move to form1
I was able to acheive this in vb6 but not in vb.net , can you please suggest
which event should i use? i tried with leave,enter and validating but could
succeed.
Dharmesh Parekh Tag: Master/detail form in vs2005 Tag: 87009
changing a data type for a field on a report, using VS 2K3 and CR
Hello,
I have an app that uses Crystal Reports for .Net. I needed to change a data
type of a field in the database and on the report. I thought it would work
fine, however now the field is always blank on the report. The field is
actually a fomula field based on a Date/Time datatype. I am assuming that
because the field is no longer a Date/Time datatype in the database that this
showing up blank. Does anyone know how to reslove this type of issue?
Also does anyone know of any good books/reference material for using Crystal
Reports bundled within .Net?
Thanks,
Chris Tag: Master/detail form in vs2005 Tag: 87008
Interactive tooltips
I want to extend the tooltip control to handle interactions with the user
via clickable links within the text. It should work a bit like this example
:
http://www.dyn-web.com/dhtml/tooltips/hover-tip.html
but of course I want this in windows forms not ASP.NET.
Any guidance anybody ? Can it be done ? Tag: Master/detail form in vs2005 Tag: 87005
ToolTip question
How do I make a tooltip remain visible until the user moves the mouse ?
Currently it stays visible for a few seconds and then disappears. Tag: Master/detail form in vs2005 Tag: 87003
The object is currently in use elsewhere
I have a splash screen that is displayed as the application starts. The
splash screen has text dynamically added to it to indicate the authorisation
mechanism and start-up progress. Due to the nature of the splash screen
graphic we have to draw the text onto the splash screen instead of assigning
text directly to each labels text property.
Internittently, one of our XP Pro SP2 test machines gets the following error
when displaying the splash screen that displays itself in a .NET Framework
invoked dialog:
Exception of type 'System.InvalidOperationException'
The object is currently in use elsewhere.
Stack Trace: at System.Drawing.TextureBrush..ctor(Image image, WrapMode
wrapMode)
at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e,
Rectangle rectangle)
at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
at System.Windows.Forms.Control.InvokePaintBackground(Control c,
PaintEventArgs e)
at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs
e, Rectangle rectangle)
at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e,
Rectangle rectangle)
at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Label.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
The splash screen invokes itself on a separate thread via its ShowSplash
method:
/// <summary>
/// Initializes and shows a new <see cref="SplashForm"/>.
/// </summary>
/// <param name="localisedApplicationName">The localised application
name.</param>
/// <param name="versionedAssembly">An <see cref="Assembly"/> from which
version information can be extracted.</param>
/// <param name="localisedCopyright1">A first line of copyright
message.</param>
/// <param name="localisedCopyright2">A second line of copyright
message.</param>
/// <param name="localisedSplashBackdropImage">The splash backdrop
image.</param>
public static SplashForm ShowSplash( string localisedApplicationName,
Assembly versionedAssembly, string localisedCopyright1, string
localisedCopyright2, Image localisedSplashBackdropImage )
{
const string THREAD_NAME = "SplashScreen";
sShownInstance = new SplashForm( localisedApplicationName,
versionedAssembly, localisedCopyright1, localisedCopyright2,
localisedSplashBackdropImage );
// Create the thread and start it; when the instance is
// closed, this thread will stop automatically...
sThread = new Thread(new ThreadStart( DoSplashScreen ) );
sThread.Name = THREAD_NAME;
sThread.Start();
// Return the shown instance
return sShownInstance;
}
The label's paint event calls DrawSmearedText:
private void lblNotice_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
DrawSmearedString( mNotice, lblNotice, Brushes.SteelBlue, Brushes.Red, e
);
}
private void lblBuildNumberAndDate_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
DrawSmearedString( BuildNumberAndDate, lblBuildNumberAndDate,
Brushes.White, Brushes.Red, e);
}
private void lblPrerelease_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
DrawSmearedString( mPrerelease, lblBuildNumberAndDate, Brushes.White,
Brushes.Red, e);
}
private void lblProgress_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
using ( SolidBrush smearBrush = new SolidBrush( Color.FromArgb( 64, 255,
255, 255 ) ) )
using ( SolidBrush textBrush = new SolidBrush( lblProgress.ForeColor ) )
{
DrawSmearedString( mProgress, lblProgress, smearBrush, textBrush, e );
}
}
The DrawSmearedString method is as follows:
private static void DrawSmearedString( string text,
System.Windows.Forms.Label label, System.Drawing.Brush smearColour,
System.Drawing.Brush overwriteColour,
System.Windows.Forms.PaintEventArgs e)
{
// Our background colour changes from light to dark, so we can't draw
// a single text colour across it. So, we do some shadow drawing by
// smearing the text around in one colour, and then overwriting it in
another.
if ( text != null && text.Length > 0 )
{
const int OFFSET = 2;
for ( int x = 0; x <= OFFSET; x++ )
{
for ( int y = 0; y <= OFFSET; y++ )
{
// Assume the label has more than one row and create an offset rectangle
on which to draw the smeared text
RectangleF drawRect = new RectangleF( x, y, label.Width, label.Height);
e.Graphics.DrawString( text, label.Font, smearColour, drawRect );
}
}
e.Graphics.DrawString( text, label.Font, overwriteColour,
label.ClientRectangle );
}
}
I have managed to produce this error once on a W2K machine but not when
using VS 2003 IDE.
We are using .NET Framework v1.1 with appropriate service packs applied.
Any ideas?
Regards,
Ian Rowland Tag: Master/detail form in vs2005 Tag: 87002
NotifyIcon and Minimize
Hello,
I have a form with a notifyicon. I have set ShowInTaskbar to false. When I
minimize the form, the form minimize, but there is a symbol on the windows
desktop for the minimized form. This symbol is the same as for child windows
which are minimized to its mdi-form. What I make wrong.
Thanks
Albert Krüger Tag: Master/detail form in vs2005 Tag: 87001
Hi
What are the steps to create a master detail form in vs2005? I have the team
suite beta2.