|
Is it possible to create a custom drop down control much like the existing Combobox, but with my own content on the drop down area? I have special needs, for instance to include a Textbox and a Button on the drop down area.
I cant figure out what kind of window the drop down area is. It must be a window since it can cross the parent form boundaries, but at the same time it doesn't remove the focus from the parent window so it acts like a regular form control. To create such a "hybrid", do I have to use the NativeWindow class, or has it all to do with redirecting window messages from the popup window to the parent window?
The ideal situation would be to have some kind of free floating "PopupPanel" control that could be added to a form, but that isn't restricted to parent form boundaries. Any clues on how to write such a control?
Regards,
Björn Morén
Stockholm, Sweden
|
|
|
|
|
What about trying to have a regular dropdown with a hidden panel (which the hiddenpanel will contain all the controls you with to show )and in the event of dropin gthe combo ,show the panel.
ByMindOnlyYouCanDoIt
|
|
|
|
|
|
Hello all,
i need to create access database programaticly and save the database file.how can i do this with the C# code.
Regards
Hay
|
|
|
|
|
|
Thanks Yaakov for you help,
I tried this code and it works fine.
but now how can i create a table with this way?
private Access.ApplicationClass AccessApp = new Access.ApplicationClass();
AccessApp.Visible = true;
AccessApp.NewCurrentDatabase(c:\test.mdb);
Regards,
Hay
|
|
|
|
|
Here is an example using ADOX. Just import the ADOX COM object as a reference.
ADOX.Catalog catalog = new ADOX.CatalogClass();
catalog.Create ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\mydb.mdb;Jet OLEDB:Engine Type=5;");
ADOX.TableClass table = new ADOX.TableClass ();
table.Name = "NewTableName";
table.Columns.Append ("MyColumnName1", ADOX.DataTypeEnum.adInteger, 0);
table.Columns.Append ("MyColumnName2", ADOX.DataTypeEnum.adVarWChar, columnSize);
table.Columns.Append ("MyColumnName3", ADOX.DataTypeEnum.adDate, 0);
catalog.Tables.Append (table);
You can also check out xsd2db. You can load the project and use the code that it uses to automatically generate an access database from an XSD.
http://xsd2db.sourceforge.net/[^]
-
Drew
|
|
|
|
|
Hi @ all,
I want to copy the contents of a richTextBox to another without loosing the text styles.
richTextBox1.Text = richTextBox2.Text // copies the text contents without the styles
or is there any option to set or an other additional store to keep the styles with the text ?
Thank in advance
Frank
|
|
|
|
|
I haven't tried this, but from the docs it looks like if you do
richTextBox1.Rtf = richTextBox2.Rtf;
that will do what you want. The .Rtf is supposed to contain the text, including the RTF formatting codes.
|
|
|
|
|
I want to update a Jet 4.0 database using databound textboxes. I was trying to find some examples of how to do this on the Net, but all of the examples that I could find were using datagrids. Does anyone know of a online example that updates a Jet database using databound textboxes. I am using a OleDbDataAdapter.
Thanks.
|
|
|
|
|
There is no difference weather you use textbox's or datagrid's. Both are just a method of displaying and editing data. The updating is done by the DataAdapter.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
lets say i have tabpages with lots of textboxes on each page. (winform)
is there a shoort way to empty all textboxes on each page?
|
|
|
|
|
I use code like the following to set control's to their default values. You can either pass in the tab page to the function or modify it slightly and pass in the tab control and step through the control's pages.
private void ClearTextBoxes (Control parentControl)
{
// Step through each control in the parent control and clear it's text if a textbox
foreach (Control control in parentControl.Controls)
{
if (control is System.Windows.Forms.TextBox)
control.Text = string.Empty;
}
}
This method has the added advantage that you can also default check boxes' and other controls' properties by adding an additional if (control is [control type]) statement in the for loop.
Hope this helps
Aaron
|
|
|
|
|
|
Hi
I have created a Windows Forms app that calls another external exe to achieve some functionality.
So now i have two exe files :-
1. Created by Windows Forms (.Net)
2. The exe being called by my app
How can i make a winforms app that includes the external exe as part of my application so that i have to finally give/install one exe on the machine.
thanks..
rt7
|
|
|
|
|
You could put the second .EXE as a resource into your primary .EXE. But! You still have to unpack it and put it back into a file on the hard rive to use it.
Bottom line is, you can't, unless you rewrite the second .EXE functionality into your primary app.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I thought I was going crazy or just a really bad programmer but its my server(localhost). Every time I try and use a dropdownbox or listbox to select a value and use it, it always uses the '0' index of the select box on post back. I tried running the Microsoft example of selected value and i get the same result... on the MS example... when i hit submit it always returns 1 no matter what i hit... anyone know what my problem is... here is the example straight from the MSDN library..
<code>
<!-- The following example demonstrates how to select items in a TextBox.
If the item is found in the text box, the item is selected and a message is
displayed stating the name of the selected item. If the item is not found,
no item is selected and a message is displayed stating that the item was not
found. -->
<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
<head>
<script runat="server">
void Button_Click(Object sender, EventArgs e)
{
// Perform this operation in a try-catch block in case the item is not found.
try
{
List.SelectedValue = ItemTextBox.Text;
MessageLabel.Text = "You selected " + List.SelectedValue + ".";
}
catch (Exception ex)
{
List.SelectedValue = null;
MessageLabel.Text = "Item not found in ListBox control.";
}
}
</script>
</head>
<body>
<form runat="server">
<h3> ListControl SelectedValue Example </h3>
<asp:ListBox ID="List"
runat="server">
<asp:ListItem>Item 1</asp:ListItem>
<asp:ListItem>Item 2</asp:ListItem>
<asp:ListItem>Item 3</asp:ListItem>
<asp:ListItem>Item 4</asp:ListItem>
</asp:ListBox>
<hr>
Enter the value of the item to select: <br>
<asp:TextBox ID="ItemTextBox"
MaxLength="6"
Text="Item 1"
runat="server"/>
<asp:Button ID="SelectButton"
Text="Select Item"
OnClick="Button_Click"
runat="server"/>
<br><br>
<asp:Label ID="MessageLabel"
runat="server"/>
</form>
</body>
</html>
</code>
|
|
|
|
|
i'm running XP Professional SP1 and asp.net 1.1 if that helps
|
|
|
|
|
|
Hi there,
I'm meeting RegEx's for the first time and have a simple question: I'd like to allow aphanumeric chars and any digits in my Validator and thus came up with: \w+\d* . Furthermore I'd like to say in my expression that the minimum length of the whole thing must be 4 (in any combination) and that the alphanumeric characters can be at any position in the string.
How do I do that?
Thanks in advance,
Matthias
I love deadlines. I like the whooshing sound they make as they fly by. [Douglas Adams]
|
|
|
|
|
|
I'm developing an application that works with parallel threads, and I need my users to now that the app is working. So, how I make a blinking notify icon.
|
|
|
|
|
|
This is about c# .net compact framework problem.
I want to change a jpg file in the pocket pc 2002 emulator to
be a byte array and then pass it via web service for furhter
processing.
I use the FileStream codes to convert the jpg to byte array
as below, when an button onclick event. As FileStream is
supported by .net compact framework.
string strFullPath = @"\\Program Files\myApp\a.jpg"; // this
is a file that must exist in above emulator folder.
ln1: FileStream oImg = new FileStream
(strFullPath,FileMode.Open,FileAccess.Read);
ln2: BinaryReader oBinaryReader = new BinaryReader(oImg);
ln3: byte[] oImgByteArray = oBinaryReader.ReadBytes((int)
oImg.Length);
ln4: oBinaryReader.Close();
ln5: oImg.Close();
However, every time when running ln1, IO exception occured
and the emulator display error message "A device with the
same name is already on the network. Tap Start > Settings >
System tab > About > Device ID tab, change your device name,
and try again"
Any idea?
Thanks much!!!
Rene Xavier
|
|
|
|
|
Hello all,
Consider the following scenario:
We run a website (intranet) on W2K/IIS5. Ve validate userrights by comparing usergroups from NT against internal validation. Now we have to move to W2003 with NT, but we have no budget to alter the Intranet. Does anybody know how we:
Can have one component get the groups from NT aswell as AD?
Point us in the direction of some usefull samples that deal with this problem?
So far, all my searches was either an NT solution, or AD, and they would never mix
Thank you for taking the time to think with me on this,
Gerwin Postma
|
|
|
|