Inherited User Control + Subclassed components + Dissapear after build!!!!!!!!!!!!!!!
This is a multi-part message in MIME format.
------=_NextPart_000_0030_01C5392C.2EA7F2B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have 2 components.
1) A User Control with a subclassed infragistics label docked =
at the top and a panel filling the rest.=20
2) A subclassed infragistics textbox control
I create a new component inherited from #1 above and then I drag my #2 =
(textbox control) onto the surface.
Everything looks great...
Build the project and the new component does not show the subclassed =
textbox. It dissapears before my eyes. But It's in the code !!!!!!!!!..
I had this working for a few minutes (I obviously thought wrong). =20
Can anyone please help.
=20
------=_NextPart_000_0030_01C5392C.2EA7F2B0
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.1491" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I have 2 components.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2> 1) =
A User=20
Control with a subclassed infragistics label docked at the top and =
a panel=20
filling the rest. </FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2> 2) =
A=20
subclassed infragistics textbox control</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I create a new component inherited from =
#1 above=20
and then I drag my #2 (textbox control) onto the surface.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Everything looks great...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Build the project and the new component =
does not=20
show the subclassed textbox. It dissapears before my eyes. =
But It's in=20
the code !!!!!!!!!..</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I had this working for a few minutes (I =
obviously=20
thought wrong). </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Can anyone please help.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2> &nbs=
p; =20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0030_01C5392C.2EA7F2B0-- Tag: WYSIWYG Editor Tag: 86173
Tray application still displays window (sort of)
I have an applicaiton that is supposed to run in the system tray but on some PCs there is a grey panel displayed. It's
not a complete window but just looks like the grey background of the window. Why does this happen and how do I get rid
of it? Tag: WYSIWYG Editor Tag: 86172
DataGrid simple question
It is probably a very simple question, but I can't find a right DataGrid
property that prevents the user from adding new rows. Of course the
'ReadOnly' property does it, but the grid cannot be read only, since the user
should be allowed to edit existing rows.
However, when I leave ReadOnly set to false, that an empty row is appearing
on the bottom of the grid so that the user can add new rows, which is what I
don't want.
Thanks
Cezar Mart Tag: WYSIWYG Editor Tag: 86171
Pause code until file fully downloaded
I have a situation where I need to scan a folder for downloaded files and
then process those files. I have a file system watcher which is looking for
the creation of a file but clearly I want wait until the file is completely
downloaded before I start trying to use it. At present I'm trying this...
Dim fi As New FileInfo(fle)
'Don't try to read while still being written
Do While fi.Length <> sz
s = TimeOfDay.Second
Do While TimeOfDay.Second = s
Loop
sz = fi.Length
Loop
...but that's going wrong on the sz=fi.length line (not immediately, but
intermittently)... telling me that the file doesn't exist.
Does anyone have a better way of approaching this?
(...and no, the sensible answer of getting the data provider to add the
creation of a 0k control file at the end of the download isn't an option.) Tag: WYSIWYG Editor Tag: 86168
Background process as delegate
I have a winform that will start directly from the scheduler. The program
will perform a batch process and put status messages on a winform.
I start up the back ground process as a delegate directly in my winform
constructor after InitializeComponent();.
Is this a good idea or is there a better way? Tag: WYSIWYG Editor Tag: 86163
RichTextBox
hi all,
In VB6 we used to have a property called OLEObjects on RichTextBox.
I used it to make my richTextbox not accept OLE objects when user tries to
paste.
Code something like following:
If RichTextBox1.OLEObjects.count > 0 Then
If Len(Clipboard.getText) = 0 Then
' show Some message regarding OLE object pasting not supported
Else
RichTextBox1.SelRTF = Clipboard.getText
End If
RichTextBox1.OLEObjects.remove (0)
End If
I want to know how can it be achieved using .net RichTextBox.
plz help me on the same.
any help would be appreciated.
thanks
Sanjay Singh Tag: WYSIWYG Editor Tag: 86160
Colour of Tab control tabs
I know how to change the background colour of a tab page, but the actual tab
itself stays grey.
In fact the whole bar in which the tab is in stays grey.
I would like to be able to change both the tab and the tab bar.
Any clues much appreciated
thanks
Rod Tag: WYSIWYG Editor Tag: 86159
Datagrid row-specific tooltips
Anyone know how to get a tooltip on each row of a datagrid ? The tooltip
text must be configured depending on the row that the mouse is hovering
over, and the hover timer must be reset when the user is moving the mouse
over the rows of the grid (but not necessarily moving off the grid).
No matter what I try I cannot get this to work ! Not using the grid's
tooltip property anyway, but perhaps there is a better way. Tag: WYSIWYG Editor Tag: 86156
With different credentials.
Dear Sirs,
I would like to run the below code using other credentials than the user
running it, how can I use different credentials?
Thank you,
Yahya
Dim msgobj
msgobj = CreateObject("CDO.Message")
msgobj.DataSource.Open(sUrl, , 3)
If msgobj.fields("urn:schemas:httpmail:hasattachment").value = True And
msgobj.fields("DAV:contentclass").value = "urn:content-classes:message" Then
msgobj.attachments.deleteall()
msgobj.fields("urn:schemas:mailheader:keywords").value = "Attachment"
msgobj.fields.update()
msgobj.DataSource.Save()
End If
msgobj = Nothing Tag: WYSIWYG Editor Tag: 86155
Databinding and Validation with UserControls
Hi folks,
I've got a Form with several Controls. One of it is a UserControl.
Then I have put some DataBinding to the Controls with
control.DataBindings.Add(...);
Know there is some strange Behaviour:
Fist: When I change to the UserControl (by clicking in the control), it
doesn't cause validation on the other control. Only if I change to another
Control the validation is occurs. The UserControl has a Property
CausesValidation wich in the Designer is set to true.
Second: I've got some problem to put the Changed value back to the
DataSource. How can I get sure that the changed value of the DataBound
Property is put back to the Control?
Thanks Tag: WYSIWYG Editor Tag: 86152
Custom Control Sizes in constructor *and* parent form
If I create a custom control that's 200x200, then drag it into my main
form, the designer adds code to set the size. This means if I open the
control, and change its dimensions, I have to also remove the ".Size =
x" line in InitializeComponent of the parent form!
Is there any way to stop properties like size, font etc. being
duplicated in the form, when they're all already present in the controls
constructor?
Thanks,
--
Danny Tag: WYSIWYG Editor Tag: 86149
How can share the value between more Windows Forms ?
hi,
Where the user input there Login Name and Password,
and I want to remerber this values In maninform,
and this values will be used by other form,
eg: Change password Form,
this need the user's name ,oldpassword, new password,
and the user's name comes from the mainform.
how can do for this ?
--
FireCrow Studio
Kylin Garden
EMail:w0wd@sohu.com
ICQ:156134382 Tag: WYSIWYG Editor Tag: 86148
Taskbar Group Icon still shows empty
I am running XP SP2
I have a VB.NET appliction that has the same icon assigned to the EXE
and all the forms.
I still get the blank group icon on the taskbar.
I have tried my Main form opening another form by executing:
theForm.ShowDialog()
theForm.ShowDialog(Me)
theForm.Show()
What else am I missing?
Thanks. Tag: WYSIWYG Editor Tag: 86147
Bug with Owner Drawn Context Menus and ComboBoxes
Have a look at the code below. It's a really simple example where I
have added two controls to a form, a textbox and a combo box. Both add
owner drawn context menus to the controls, but the combobox will NOT
draw custom drawn context menu item. I have tried EVERYTHING (deriving
from MenuItem and even tried calling TrackPopupMenuEx directly), but
it just won't work!
I am currently reflecting over the combobox source code (oh joy!), but
if anyone can help me, I will BE SOOOOO VERY GRATEFUL!!!!
thanks
andrew
using System;
using System.Drawing;
using System.Diagnostics;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace ComboContextBug
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private ComboTest comboBox1;
private TextBoxTest textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
} base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.comboBox1 = new ComboContextBug.ComboTest();
this.textBox1 = new ComboContextBug.TextBoxTest();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// comboBox1
//
this.comboBox1.Location = new System.Drawing.Point(180, 32);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(121, 21);
this.comboBox1.TabIndex = 0;
this.comboBox1.Text = "comboBox1";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(180, 98);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(121, 20);
this.textBox1.TabIndex = 1;
this.textBox1.Text = "textBox1";
//
// label1
//
this.label1.Location = new System.Drawing.Point(8, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(168, 52);
this.label1.TabIndex = 2;
this.label1.Text = "Right click this combo and you will see that
the OwnerDrawn item does NOT appear!" +
"";
//
// label2
//
this.label2.Location = new System.Drawing.Point(8, 86);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(168, 52);
this.label2.TabIndex = 3;
this.label2.Text = "Right click this textbox and you will see that
the OwnerDrawn item DOES appear!";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(336, 157);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.comboBox1);
this.Name = "Form1";
this.Text = "Combo Context Menu Bug";
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
public class ComboTest: ComboBox
{
public ComboTest()
{
base.ContextMenu = new ContextMenu();
MenuItem mnuOwnerDraw = new MenuItem();
mnuOwnerDraw.Text = "This text WILL NOT appear on a ComboBox!";
mnuOwnerDraw.OwnerDraw = true;
mnuOwnerDraw.DrawItem +=new
DrawItemEventHandler(mnuOwnerDraw_DrawItem);
mnuOwnerDraw.MeasureItem +=new
MeasureItemEventHandler(mnuOwnerDraw_MeasureItem);
base.ContextMenu.MenuItems.Add(0, mnuOwnerDraw);
MenuItem mnuNormalDraw = new MenuItem();
mnuNormalDraw.Text = "This text WILL appear!";
mnuNormalDraw.OwnerDraw = false;
base.ContextMenu.MenuItems.Add(0, mnuNormalDraw);
}
private void mnuOwnerDraw_DrawItem(object sender, DrawItemEventArgs
e)
{
MenuItem menu = sender as MenuItem;
e.Graphics.DrawString( menu.Text, this.Font,
SystemBrushes.ControlText, e.Bounds.X + 15, e.Bounds.Y );
}
private void mnuOwnerDraw_MeasureItem(object sender,
MeasureItemEventArgs e)
{
MenuItem menu = sender as MenuItem;
string text = menu.Text;
e.ItemWidth = (int)(e.Graphics.MeasureString(text,
this.Font).Width) + 3;
e.ItemHeight = (int)(e.Graphics.MeasureString(text,
this.Font).Height) + 2;
}
}
public class TextBoxTest: TextBox
{
public TextBoxTest()
{
base.ContextMenu = new ContextMenu();
MenuItem mnuOwnerDraw = new MenuItem();
mnuOwnerDraw.Text = "This text WILL appear on a Textbox!";
mnuOwnerDraw.OwnerDraw = true;
mnuOwnerDraw.DrawItem +=new
DrawItemEventHandler(mnuOwnerDraw_DrawItem);
mnuOwnerDraw.MeasureItem +=new
MeasureItemEventHandler(mnuOwnerDraw_MeasureItem);
base.ContextMenu.MenuItems.Add(0, mnuOwnerDraw);
MenuItem mnuNormalDraw = new MenuItem();
mnuNormalDraw.Text = "This text WILL appear!";
mnuNormalDraw.OwnerDraw = false;
base.ContextMenu.MenuItems.Add(0, mnuNormalDraw);
}
private void mnuOwnerDraw_DrawItem(object sender, DrawItemEventArgs
e)
{
MenuItem menu = sender as MenuItem;
e.Graphics.DrawString( menu.Text, this.Font,
SystemBrushes.ControlText, e.Bounds.X + 15, e.Bounds.Y );
}
private void mnuOwnerDraw_MeasureItem(object sender,
MeasureItemEventArgs e)
{
MenuItem menu = sender as MenuItem;
string text = menu.Text;
e.ItemWidth = (int)(e.Graphics.MeasureString(text,
this.Font).Width) + 3;
e.ItemHeight = (int)(e.Graphics.MeasureString(text,
this.Font).Height) + 2;
}
}
} Tag: WYSIWYG Editor Tag: 86146
Application icon in VC++
Hello,
I am using Visual C++ .NET and developing new windows forms application.
What I need is to change the default application icon (the one that is seen
in windows explorer) to my icon. I tried:
- Look for 'application icon' in project settings - no luck, suppose this
option is available only in C# or VB projects.
- Changing app.ico to my icon: this works fine, but this changes only 32x32
icon, but in list view in explorer this changes to default 16x16 icon
- Using /win32icon:myicon.ico as an option of compiler (set in project
settings) - it does not recognize this option as known option.
Thanks in advance for assistance.
Alex. Tag: WYSIWYG Editor Tag: 86140
dropdownlist - index of an item
Hi,
I have in a dropdownlist the following values: "aa", "bb", "cc"
I want the item "bb" will be the selected item. I can find it in a
collection by:
myItem = myControl.Items.FindByText("bb");
To make this item selected I can use:
int index = myControl.Items.IndexOf(myItem).
is there any more simple way how to do it? Something like index =
GetIndex("bb"); i can not find such a method.
Thanks,
Lubomir Tag: WYSIWYG Editor Tag: 86138
How can I limit the number of the applicatin' login trying ?
I give a login form for my application,
and I give 3 times to the app's user,
if he input his name and pwd out 3 times,
the login form will closed .
how can I do it ? Tag: WYSIWYG Editor Tag: 86132
Datarepeater
Hi, NG!
Is there any updated version (.Net) of the Datarepeater control or do I have
to use the old (VS6.0) version?
Thanks.
pax Tag: WYSIWYG Editor Tag: 86131
How to set screen color depth and disable hardware acceleration in .net?
Hi,
Does anyboy know how to implement following 2 features in .net?
1.Change screen color depth
2.Disable hardware acceleration
So far, I know how to change screen resolution in .net, but havent found
solutions for above 2 requirements.
Looking forward to ur reply.
Thank,
William Tag: WYSIWYG Editor Tag: 86129
At what point does the MDI parent become visible?
I want to put code that executes only once at the first available point after
the MDI parent form is visible so I can give feedback to the user while the
application is retrieving configuration data from a database and doing other
setup work. The _Load is too early because the form is not yet visible, and
_Activated seems not well suited because it fires too frequently. The
closest I've come is to use _Activated with a Boolean set after the first
call so the setup code doesn't execute, but it still seems ill-suited.
Any suggestions would be greatly appreciated. I'm a DBA by trade, so bear
with me. Tag: WYSIWYG Editor Tag: 86128
best contol for capturing steaming and displaying streaming input?
I have a Windows forms application that is reading messages off off a queue,
and I want to stream them into a window to view. Currently I am using a
textbox classes/methods of textbox.Append(...) and textbox.ScrollToCaret()...
It seems that there is limit to the number of characters you can write to a
textbox...
I would appreciate any recommendations on the best contol/technique to used
to stream input into a form and to automatically advance the scrollbar as
input arrives. I want to capture several thousand lines before I cleanup...
thanks Tag: WYSIWYG Editor Tag: 86119
Creating a 1bpp mask from a byte array
Hi
First of, I am posting to this newsgroup as it seemed best suited even though I am writing C++ for a standard Windows application. The application uses GDI+ which forms the basis of the System.Drawing namespace...anyway here goes:
I am trying to create a 1 bit per pixel mask to use as an overlay. The data for the mask i generated dynamically based on user input and is available as a byte array. I get the first failure when trying to create the mask bitmap, the code is a follows:
/**
* Utiliy method, creates a mask bitmap and modifes the palette accordingly.
* @param size Size of the mask.
* @param color Color of the mask.
* @param pixels The pixels.
*/
Bitmap* createMask( const Size& size, const Color& color, Byte* pixels ) {
Bitmap* mask = new Bitmap( size.width, size.height, ((size.width+3)>>2)*4/8, PixelFormat1bppIndexed, pixels );
UInt paletteSize = mask->GetPaletteSize();
if( paletteSize > 0 ) {
ColorPalette* palette = (ColorPalette*)malloc( paletteSize );
mask->GetPalette( palette, paletteSize );
if( palette->Count == 2 ) {
palette->Entries[0] = Gdiplus::Color::Black;
palette->Entries[1] = Gdiplus::Color::MakeARGB( color.GetA(), color.GetR(), color.GetG(), color.GetB() );
}
mask->SetPalette( palette );
free( palette );
}
return mask;
}
Since that didn't work, I tried letting GDI+ create a mask bitmap of the specified size and the copy the pixels into that bitmap. But when I try to display the image I either get nothing or a GPF. My display code is very simple:
// Bitmap *maskBitmap; // Defined elsewhere
Graphics g( hDC );
g.DrawImage( maskBitmap, 0, 0 );
So it basically just creates Graphics object and attempts to draw the image. The latter fails however...
Teis Johansen Tag: WYSIWYG Editor Tag: 86118
HELP NEEDED REGARDING MAKING OTHER LANGAUGE (i.e. HINDI)ENABLED WINDOWS APPLICATION IN .NET
(Type your message here)
--------------------------------
From: kinshuk kukreti
hi every one
i am new to .net development
my problem is that i want to make a windows application
which could enable the user to enter data in HINDI language
i have seen their is some property of form like
LOcalizable ,language,IME Mode
and of text box like IME MOde
what i am doing is using MAngal font Which is used for Hindi Language
for text box and setting its IME Mode property to True at design time
i'm also setting IME MODE property of form to true and also setting LOCAlizable to true and LAnguage property to HINDI
i have also installed the IME 1.1
it is working fine with the MICROsoft Word
and showing a bar which displays Help etc.
But in .NET it not showing anything
but at run time i'm not getting the desired results
does any body here can help me
i'm sure i'm wrong some where
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>WAKtCPMagUiZGjwvLxsVrg==</Id> Tag: WYSIWYG Editor Tag: 86116
making forms larger than screen size
(Type your message here)
--------------------------------
From: Zaher Zeidan
is there a way to resize a form so that it's bigger than the screen size of the windows??
I mean if you run your windows with 780x1024 resolution you won't be able to set your height or width to any thing larger than this..
this is really stupid from the IDE to prevent developers from resizing the form larger than the screen area since this would enable you to get a lot of space in design time and/or using scroll bars to put lot of controls in one window..
Old Visual Studio didn't have this limitation..
anyone knows a workaround for this???
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>/ORUU75l20+l5QvA6bsPPg==</Id> Tag: WYSIWYG Editor Tag: 86114
CheckedListBox::SetItemChecked will not display properly on TabCon
Hi all
I have this checkedlistbox that appears on a winform that has a tabstrip
control. The tabstrip control has say more thatn 2 tabs. On the first tab
there is a checkedlistbox. The checkedlistbox first loads all possible items
from a database; say 10 options total for a user to select. I then make
another call to a database table that has the previously selected options for
the checkedlistbox. All the data comes back from the database fine. I am
able to use the SetItemChecked method to set which ever items in teh
checkedlistbox as checked, but when it finally is rendered on the screen,
none of the checked items show as checked. If I move the checkedlistbox to
another tab that is not to display at the time of rendering for the form, I
can select that tab and the items are checked.
I am wondering if any of you have seen anything similar to this. Thanks for
any assitance. Tag: WYSIWYG Editor Tag: 86113
How to change the font in the grid?
My textboxes use Tahoma, 9. I want to use the same for my grid. Is is
possible? How do I do this?
I found this:
DataGrid1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))
in another forum, but I'm getting "'Point' is not a member of
'System.Drawing.GraphicsUnit'."
If I change Point to Pixel, I get "Overload resolution failed because no
accessible 'New' accepts this number of arguments." Tag: WYSIWYG Editor Tag: 86106
How to make the gray area of the grid white?
I'm developing an application for Pocket PC in VB .NET. My grid can contain
up to 10 rows, but my table has only 2 and I see the dark gray area. Is there
a way to change the color of it? 'DataGrid1.BackgroundColor' works for a
Windows Application, but not Smart Device Application... Tag: WYSIWYG Editor Tag: 86105
Validating event not firing for a checkbox
Hi,
I am generically adding a handler for the Validating event of various
controls. When added to a checkbox, the event never fires. Any solution
here? Tag: WYSIWYG Editor Tag: 86104
Data path changes after saving files with SaveFileDialog
Using VB.NET
I have the path to my Access file stored in an App.config file:
<add key="constring" value="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=Data/METL.mdb;Persist Security Info=False"/>
I usually set the connection like this:
'* Get the appSettings constring value (set in the web.config)
strConstring =
System.Configuration.ConfigurationSettings.AppSettings("constring")
'* Connects to database
ocnConnection = New OleDb.OleDbConnection(strConstring)
After creating an Excel file and saving it to a folder other than the
application folder, my database connections always try to find the database
file in the folder the Excel file was saved to.
If dlgSaveFile.ShowDialog() = DialogResult.OK Then
Excel.DisplayAlerts = False
Excel.AlertBeforeOverwriting = False
Excel.ActiveWorkbook.SaveAs(dlgSaveFile.FileName)
Excel.ActiveWorkbook.Close()
Else
Excel.ActiveWorkbook.Close(False)
End If
Thanks,
Sacha Tag: WYSIWYG Editor Tag: 86103
Drag a tree view node on to a richedit
I want to be able to drag a treeview node, drop it on to a rich edit box and
when that event occures, insert some text into the rich edit at the location
that the node was dropped.
Possible? Any hints on how to do this, as I'm not sure where to start. Tag: WYSIWYG Editor Tag: 86101
Windows app access db internet
Hi,
I built a windows form client app that access a db on a network. Now I was
wondering how can I set it up so that the app accesses the database through
the web? I don't want to rebuild the client app into an asp.net app. Maybe I
could or should use Web Services that sits on a web server with database and
do my updating through this route. What do you guys/gals think?
Thanks,
JJ Tag: WYSIWYG Editor Tag: 86099
WinForm Behavior
Hi.
I´m developing an MDI aplication and I have a base form from where all child
windows inherits. The issue is that all the controls I place in the
inherited child form at design time use say Arial 12 font and the textboxes
are 20pixels hi, however at runtime everything ends up twice as large than
designed, like Arial 16 and textboxes 40pixels hi.
So far this is cool because I infact need to adjust the size of the controls
all over the aplication according to the resolution it is being running on.
However I don't know what feature is that and need to know what it is in
order to control it!
Any ideas? is it the base form used by the child windows or is something on
the MDI container that somehow "inherits" some property to the controls the
contain?
Thanks in advance,
Nando Tag: WYSIWYG Editor Tag: 86095
Multirow listview (sort of)
I have a problem with my windows form.
I want to display items that doesn't fit on one row in a listview.
I would like to find a control which enables me to add all my columns but
one to the first row and the last column on the second row.
If it was a html-table an item would look like this
<tr><td>Column 1</td>
<td>Column 2</td>
<td>Column 3</td>
</tr>
<tr>
<td colspan="3">Column 4. Big.</td>
</tr>
It would be nice if the control would be similar to a listview in Details-view
(able to change the width and sort on the columns in the first row).
/nisse Tag: WYSIWYG Editor Tag: 86093
What happens when WindowState =Minimized ?
Hi, i found unusal things happening when Program main window is minimized.
I'm writing large programm on C# and having problem whith memory size
allocated bu program.
Every time i use some dialog's ShowDialog() the memory size of process
increases.
But ones i minimize main window memory size decreases significantly (for
example : program that was just loaded whith 2 nonmodal dialogs takes 35 MB,
after Minimize and Restore it becomes 5 MB after restoring comes 8MB).
My questions are :
Which actions are take when window is minimized ?
How can I reproduse these actions in order to decrease used memory size
(Without Minimize & Restore)?
I tried with GC.Collect() it doesnt help.
Please help.. I need it very urgent.
Giga Tag: WYSIWYG Editor Tag: 86081
An Application's forms
Is it possible to get a reference to a collection of all an Application's
loaded forms?
I want to do something like...
For each Form in Application.Forms
Form.ResetLocation
Next Form Tag: WYSIWYG Editor Tag: 86080
Skip LinkLabel in TAB order
I have designed a custom control derived from UserControl which contains a
LinkLabel and a TextBox. If the user uses the TAB key to move the focus to my
custom control I want the TextBox to get the focus and not the LinkLabel.
Therefore I set the TabStop property of the LinkLabel control to False (in
the constructor of my custom control, after InitializeComponent()). However,
the TabStop property of the LinkLabel is ignored and it still gets the focus.
As a workaround I tried to override OnEnter of my custom control:
Protected Overrides Sub OnEnter(ByVal e As System.EventArgs)
myTextBox.Focus()
End Sub
Unfortunately this doesn't work either. The TextBox gets the focus but
immediately afterwards the focus moves to the LinkLabel. Overriding
OnGotfocus results in the same behaviour.
How could I prevent the LinkLabel to get the focus if the user uses the TAB
key to move the focus to my custom control?
Thanks for any ideas,
Guido Tag: WYSIWYG Editor Tag: 86077
How to achieve the following functionality with Windows Forms ?
I have a useful framework, written in a different language (PowerBuilder),
which I'd like to replicate in .Net and Forms, but I'm unsure of how to
approach it, as the Event model is being used different between the
development environments.
Currently we have data entry screens, whose columns have been "wired" into a
class that performs checks on the entered data. As the user "leaves" a
column, the specific check / business rule is carried out. A lot of the
checks are common across all the screens and linking the column to the
specific method to be called is as easy a giving the column the appropriate
Name.
How can I create my own framework which would allow an easy method of
connecting / wiring the columns and the method checks together. I was
planning on using DataGrids, but can change that if I need to. Tag: WYSIWYG Editor Tag: 86075
Inherited controls in worng location
Please can you explain the following...
I create a new form and add to it the following objects: a MainMenu, A
MenuItem, a PictureBox and a Button. I change the button properties so that
it is anchored BottomRight.
I then create another form which inherits from the first. And I add to it
another Button object. I then build my project. After the project has been
built the first Button object's location moves up by one pixel!
With some experimentation I've found this happens with other objects too but
equally, in some circumstanmces, if doesn't happen at all.
Can you explain why and whether there is a solution? Tag: WYSIWYG Editor Tag: 86074
Urgent Help : Re-select Combobox Value
Dear all,
I'm doing a winform project which uses "ComboBox" in one of the form. The
winform contains "ComboBox" with the values as below: -
this.ComboBox1.Items.AddRange(new object[] {"Apple", "Orange", "StrawBerry"});
Users will select on of the item from the combobox and stored into database.
Users have the rights to update this record.
The question is, how do I select the combobox value base on the value from
database?
I have used "SelectedText", "SelectedValue", but it doesn't seem to be
working.
Please Help. Thanks in advance.
Cheers,
Mae Tag: WYSIWYG Editor Tag: 86068
Form question (Re-usuable code)
Is there any way of making the following code into a function so that I
don't have to re-use the same code for all my buttons? I've tried to do this
with the code at the bottom of my post but I get a build error saying 'Type
FormToShow is not defined'.
Cheers,
Paul
Private WithEvents Example1Form As frmDragDropFromExplorer
Private WithEvents Example2Form As frmDragDrop
Public Shared Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New frmMain)
End Sub
Private Sub btnExample1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExample1.Click
Try
Example1Form.Show()
Catch
Example1Form = New frmDragDropFromExplorer
Example1Form.Show()
Finally
Example1Form.Focus()
End Try
End Sub
---- Tried this but got the error 'FormToShow is not defined' ---
Private Sub btnExample1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExample1.Click
ShowForm(Example1Form)
End Sub
Private Function ShowForm(ByVal FormToShow As Form)
Try
FormToShow.Show()
Catch
FormToShow = New FormToShow
FormToShow.Show()
Finally
FormToShow.Focus()
End Try
End Function Tag: WYSIWYG Editor Tag: 86062
Form question (Re-usuable code)
Is there any way of making the following code into a function so that I
don't have to re-use the same code for all my buttons? I've tried to do this
with the code at the bottom of my post but I get a build error saying 'Type
FormToShow is not defined'.
Cheers,
Paul
Private WithEvents Example1Form As frmDragDropFromExplorer
Private WithEvents Example2Form As frmDragDrop
Public Shared Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New frmMain)
End Sub
Private Sub btnExample1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExample1.Click
Try
Example1Form.Show()
Catch
Example1Form = New frmDragDropFromExplorer
Example1Form.Show()
Finally
Example1Form.Focus()
End Try
End Sub
---- Tried this but got the error 'FormToShow is not defined' ---
Private Sub btnExample1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExample1.Click
ShowForm(Example1Form)
End Sub
Private Function ShowForm(ByVal FormToShow As Form)
Try
FormToShow.Show()
Catch
FormToShow = New FormToShow
FormToShow.Show()
Finally
FormToShow.Focus()
End Try
End Function Tag: WYSIWYG Editor Tag: 86061
Windows Forms .NET 2.0 Advice
Hello,
I could use some advice. I have an application to build for a client the
must be developed as a windows form application. This is an application that
was written years ago using VB6 and an access database.
I am an experienced .Net developer, version 1.1 but have built web
applications, not windows forms.
Should I consider .NET 2.0 for this application? I do not have windows form
experience in .net so there will be a learning curve either way. Are there
enough new features in .net 2.0 windows forms to consider this?
Also, can you point me to any good docs on the subject.
Thanks
scott Tag: WYSIWYG Editor Tag: 86060
Windows Form and Windows Form User Control - Where Is The Method That Would corresspond To A Web Form Pre_Render Method
Hello
MyMainWebPage.aspx contains MyUserControl.ascx
MyUserControl.ascx has a DataTable Property MyDataTable
MyUserControl.ascx has a DataGrid which whose datasource is MyDataTable (or
technically it's private accessor but that I don't think is an issue here)
MyMainWebPage creates a DataTable dt . I then do a
"MyUserControl.MyDataTable = dt"
In order for the data to appear in the user control grid I must do the
"MyUserControl.MyDataTable = dt" in the Pre_Render of MyWebPage
I want to do this type of thing with a window form and windows user control.
Where in the windows form user control would I bind the datatable? If I do
it in the user controls page_load it does show the data in the datagrid?
Thank you,
Richard Tag: WYSIWYG Editor Tag: 86051
datagrid colum's nulltext property displayed in column when field not null
I have a record displayed in datagrid and 2 columns says the text i've
designated as the nulltext for those columns, but when i look at the data in
the db, those values are listed there.
is there some issue/bug that can be causing this?
thanks Tag: WYSIWYG Editor Tag: 86047
Re: Using a string array as a datasource in a listbox
"claire clinton" claire.clinton@cae.com wrote:
> How do I add a string array as a llstbox datasource in the=20
> designer? I have a static class that defines an array and=20
> don't want to rebuild it in the designer. But I have to=20
> manually add the setting of the listbox datasource in code=20
> since the designer seems to only allow adding datasets as=20
> a datasource. This would be ok except when I go back to=20
> the designer, it converts the datasource assignment of the=20
> class array to an equivalent hard coded new string array=20
> and then adds an Item.AddRange assignment for the same=20
> string which then aborts when I run with the error=20
> message "Can't modify the Items collection when the=20
> DataSource property is set". I fix this by deleting the=20
> designer added code and putting my Datasource assignment=20
> back in. This is extremely annoying and will be=20
> unnacceptable for my final product. How can I prevent this=20
> from occuring.
I am having a similar problem.
Can anyone suggest how to solve it?
Thanks,
Alex.
--=20
Please replace myrealbox with alexoren to reply by email. Tag: WYSIWYG Editor Tag: 86045
How can I turn off the ControlBox but still have Close in the upper right of a form?
I know I've done this in the past but can't remember how I did it.
How can I turn off the ControlBox but still have the Close X in the upper
right of a Form?
It's some combo of FixedDialog and ControlBox = false
thanks
mike Tag: WYSIWYG Editor Tag: 86044
Problem binding a listbox to an array
Hello people,
I am having problems binding a listbox to an array.
Using Visual Studio 2003 with framework 1.1
That's the array:
internal class Data
{
private Data() {} // static class
public static readonly string[] states =3D { "Alabama", =
"Alaska", "Arizona", /* ...*/ "Wisconsin", "Wyoming"};
}
I also have a listbox on a form. The auto-generated code is:
// listStates
this.listStates.Name =3D "listStates";
this.listStates.TabIndex =3D 0;
this.listStates.Location =3D new System.Drawing.Point(8, 16);
this.listStates.Size =3D new System.Drawing.Size(100, 82);
this.listStates.SelectionMode =3D =
System.Windows.Forms.SelectionMode.MultiSimple;
Question number 1:
In the designer, the DataSource property of the listStates ListBox is =
not editable.
I would like to bind it to the array at design time but I cannot.
I that supposed to be like that or am I missing something?
Question number 2:
When I added the following statement
listStates.DataSource =3D Data.states;
it appeared to work but I started having weird behaviour regarding the =
selection.
In particular, after selecting several items and unselecting all of =
them, the first item would become selected.
What am I doing wrong?
Thank you,
Alex.
--=20
Please replace myrealbox with alexoren to reply by email. Tag: WYSIWYG Editor Tag: 86043
I am looking for Wysiwyg Control for one of my projects - under C#
windows forms Framework 1.1
Pretty simple WYSIWYG control is the RichTextBox control that comes with the
Windows forms library.
--
Stoitcho Goutsev (100) [C# MVP]
<rsanan@gmail.com> wrote in message
news:1112644818.495808.94330@g14g2000cwa.googlegroups.com...
>I am looking for Wysiwyg Control for one of my projects - under C#
> windows forms Framework 1.1
>
> Any thing simple and easy to implement.
>
> Thanks
>