|
Hi,
you can read the text in bytes and then insert the bytes (search on google:write blobs in database) in database.
-- modified at 5:19 Thursday 23rd August, 2007
|
|
|
|
|
I am planning on making the dialog for the custom settings for a software.
On the dialog, on the vertical left side, there would be the listbox showing "password", "Wired", "RF", "Save Folder Location" stuff like that on the list box.
Now, in the group box, I would have the different components showing in the groupbox on the right side, depending on the selected item on the listbox.
Should I use groupbox[], and the index in [] be based on listbox selected index?
Should I call a method, based on the listbox name so it would dispose the existing group box and generate a new one?
I hope this is not confusing...
|
|
|
|
|
I'd create a user control that displays the properties of each aspect of your software. Then, swap in (make visible, set position) the appropruate panel on the right of the list box when the selection changes. You'll need to prevent a selection change if validation of the currently displayed panel fails.
/ravi
|
|
|
|
|
Hi,
the easiest approach for showing a lot of groupable settings, is by using a
Tab Control with several TabPages. The tabs would be organized horizontally then.
If you really want it with the tabs to the left, I suggest you build your own
Tab Control look-alike.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Or you could wire up a ListBox and a TabControl to solve this problem.
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.tabControl1.Region = new Region(new RectangleF(this.tabPage1.Left, this.tabPage1.Top, this.tabPage1.Width, this.tabPage1.Height));
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (((ListBox)sender).SelectedIndex == 0)
tabControl1.SelectTab(0);
else
tabControl1.SelectTab(1);
}
}
I'm using the region setting to hide the TabPage selections from the UI, so the ListBox can be used to control the TabPage display. Obviously, you migth have more than two TabPages, so you'd need to change the listBox1_SelectedIndexChanged() event to control your TabPages as you need.
I hope that helps.
|
|
|
|
|
I don't know if this is the right section to ask this question
but if someone have some idea i appriciate his help
when i do the wizard step to do the replication this error occur always:
The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "REPLLINK_TELECOPLUS519346055_DATETIMEDA579057684_PUB5-1837106822_EMPTYFORRE236221469" was unable to begin a distributed transaction.<br />
Changed database context to 'emptyForRep'.<br />
OLE DB provider "SQLNCLI" for linked server "REPLLINK_TELECOPLUS519346055_DATETIMEDA579057684_PUB5-1837106822_EMPTYFORRE236221469" returned message "The partner transaction manager has disabled its support for remote/network transactions.". (Microsoft SQL Server, Error: 7391)
I'm re-sorry to ask this question in this section
Assaf
|
|
|
|
|
IN VB.NET I use to write :
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click,Button2.Click, Button3.Click
and any code inside
End Sub
I use this way if i want many button to do the same thing
My Question is how i can do like this in C#
it's urgent for me
Thanks in advance
Assaf
|
|
|
|
|
One way would be:
Button1.Click += new System.EventHandler(this.Buttion1_Click);
Button2.Click += new System.EventHandler(this.Buttion1_Click);
Button3.Click += new System.EventHandler(this.Buttion1_Click);
Hope that helps.
Ben
|
|
|
|
|
Where I should this snipet of code ???
Assaf
|
|
|
|
|
Form load would be a good place to put that snipet of code. That way it only runs once. If the code were to run twice you would get multiple calls to your button click event which would be very bad.
Ben
|
|
|
|
|
I pure GUI way would be to go to your form. Click on Button1 then go to the properties window. Click the lighting bolt this shows you the events for the button. Select the correct button click event. Repeat for other buttons.
Hope that helps.
Ben
|
|
|
|
|
I didn't get the methode of inserting code
and it not work if i put them in load form
but i try the second method to for the clickevent in the properties and it work
thank a lot
Assaf
|
|
|
|
|
Or you can just double-click the button
|
|
|
|
|
That works for the first event only. If you want to point the other two buttons to the same event you can not double click.
Ben
|
|
|
|
|
No, you click on properties, then the lightning bolt ( to show events ), find the click event, click in the box, click the drop arrow and select the method name.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
That is what I said in my earlier post. In my post you are responding to I said you can't double click to assign the same event to multiple buttons.
Ben
|
|
|
|
|
I would suggest that you create two simple projects, one in VB and the other in C#. In both applications you would have a form with three buttons. In VB have a method that handles the button clicks for the controls like what you have above. In C# you would assign the method to the click event of each of the three controls. Run the programs to make sure they do what you want. Then examine the IDE generated code, the code that contains all the event/control/layout declarations for VB and VC#. Compare what is similar/different with the two languages.
Hopefully this helps.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
I added a lot of ComboBox controls to WinForms form.
Every combobox shows all its content selected.
Selection is removed only when I tab off from the control.
How to hide selection initially?
There is not HideSelection property in Combobox.
This occurs if I set autocomplete properties.
class myComboBox : ComboBox {<br />
internal myComboBox(DataRow dr, DataTable table) {<br />
DisplayMember = "DisplayMember";<br />
ValueMember = "ValueMember";<br />
DataSource = lookup.GetPickList();<br />
DataBindings.Add("SelectedValue", table,<br />
dr["controlsrc"].ToString());<br />
AutoCompleteSource = AutoCompleteSource.ListItems;<br />
AutoCompleteMode = AutoCompleteMode.SuggestAppend;<br />
}}
Andrus
|
|
|
|
|
Have you found a solution to this? I am currently having a similar problem when binding a DataTable to my comboboxes...
|
|
|
|
|
No I havent found any solution to this .net bug.
Maybe it is possible to acces the underlyoing textbox which is contained in Combobox in combo constructor and set it HideSelection property to false.
Andrus
|
|
|
|
|
Hi all,
please i need the win32 API function to know the fact that is desktop changed.
Thank you in advance.
naresh is testing the site.
|
|
|
|
|
I'm not sure the exact answer, but anytime you are looking for a Win32 API function, you should check out the site http://www.pinvoke.net/.
Hogan
|
|
|
|
|
Thank you very much guys.
i look around your hints and links.
hope it works.
naresh is testing the site.
|
|
|
|
|
Hi,
what changes on the desktop ?
AFAIK:
- the resolution, the pixel depth, ... that will fire a Paint event; see also
the SystemEvents class.
- the icons (new, renamed, moved,...): no event available
- the background image: no event available
Hope this helps
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Actually i need to send the image of my desktop to remote computer whenever desktop gets changes. So for this, the i am expecting a common event(for opening new window on the desktop ,selecting the desktop area,minimizing and maximizing any window over the dekstop) that can be caught in my application and at the same time it sends the desktops changed image to the remote computer. So plz any body have any idea?? Actually i know there happens a Paint System event, if so how can i handle this event in my application to know the changed state of my desktop??
Thank you in advance!!
naresh is testing the site.
|
|
|
|