|
If you just want UML, then use Visio Pro; with Standard (or the "Student") you can usually find free templates on the web for UML.
Visio "Architect" is what you're otherwise referring to; i.e. generate software out of Visio / reverse engineer.
|
|
|
|
|
I have a requirement of reading the current directory opened in foreground Windows Explorer.
I am checking whether windows explorer is in foreground or not from this.
how to do this ? please help me.
|
|
|
|
|
|
I need the lines of code to help me link text to pre-recorded sounds.
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
All we get to work with is exactly what you type: we get no context beyond that...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Well, you could convert the "sounds" to text; or the text to "sounds"; and compare them...
What would you like?
|
|
|
|
|
What do you want to achieve? What's the input, and what should be the result?
Do you have some text and some sound file corresponding to that text, and now you want to create an application which shows the text, plays the sound, and highlights the position in the text? Or plays the sound corresponding to some selected part of the text? Or ...?
|
|
|
|
|
I have a requirement of enabling drag option for border less form within a fixed location of screen.
I am reading the windows explorer’s position for this method. Then I will place an icon within window’s explorer window and planning to allow dragging of that form everywhere inside the windows explorer.
How to do this ?
|
|
|
|
|
I'm not clear on what you describe here.
You find the current position of Win Explorer ... what if there are multiple folder views open ?
You move an icon within a Win Explorer window ... how do you keep it on top ?
What is the borderless Form you refer to ... what is its relationship to the icon, or the Win Explorer window ?
Making a Windows Form draggable is easy; how do you want the user to start dragging it ... by click-dragging anywhere on the Form not covered by a Control ? by clicking on some visual indicator ? by clicking on a certain region in the Form ?
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
BillWoodruff wrote: You find the current position of Win Explorer ... what if there are multiple folder views open ?
You move an icon within a Win Explorer window ... how do you keep it on top ? I manage multiple windows with the handle of the window. See my previous question.
I am keeping the form on top of explorer by setting "me.topmost" property.
I want to allow dragging of form on mouse left click down everywhere inside the form but that form should be draggable within specified location of window (i.e within windows explorer window)
|
|
|
|
|
You still have not clearly explained what the use of the Icon and the Form isQuote: I want to allow dragging of form on mouse left click down everywhere inside the form but that form should be draggable within specified location of window (i.e within windows explorer window) This statement implies you have two Forms, and that one is dragged within the bounds of the other.
Please try and describe clearly what you are trying to achieve, and, why are you trying to change the appearance of what the user sees in an Explorer Window ? Describe exactly what your app creates.
The use of "me.topmost" suggests this is a VB Project ... is that correct ?
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
|
|
|
|
|
Hi
I have windows form.in that
I have table tbluseraction
actionid actionname
-------------------------
1 read
2 write
3 delete
I have another table tbluserform
formid formname
---------------------------------
1 frmbackup
2 frmrestore
Now i want to give premission to each form.I have check box for every permission
after giving rights it is saved in table as
formid actionid
1 1
1 2
2 1
I have given source code and Please help me
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace DERPS
{
public partial class frmERPRights : Form
{
int ModuleCode;
int UserCode;
DataTable dtColumns;
public frmERPRights()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
dgvERPPermission.Columns.Add("clmFormCode", "Form Code");//0
dgvERPPermission.Columns.Add("clmFormDescription", "Form Description");//1
using (SqlConnection CNN = new SqlConnection(AppManager.GetConnectionString()))
{
CNN.Open();
using (SqlCommand scmd = new SqlCommand()) {
scmd.CommandText = "select ActionCode, ActionName from erpactions where isPermissible=1";
scmd.Connection = CNN;
SqlDataAdapter sda = new SqlDataAdapter(scmd);
dtColumns = new DataTable();
dgvERPPermission.AutoGenerateColumns = false;
sda.Fill(dtColumns);
foreach (DataRow row in dtColumns.Rows)
{
DataGridViewCheckBoxColumn checkColumn = new DataGridViewCheckBoxColumn();
checkColumn.Name = row[0].ToString();
checkColumn.HeaderText = row[1].ToString();
checkColumn.Width = 50;
checkColumn.ReadOnly = false;
checkColumn.FillWeight = 10; //if the datagridview is resized (on form resize) the checkbox won't take up too much; value is relative to the other columns' fill values
dgvERPPermission.Columns.Add(checkColumn);
}
}
}
using (SqlConnection CNN = new SqlConnection(AppManager.GetConnectionString()))
{
CNN.Open();
using (SqlCommand scmd = new SqlCommand())
{
scmd.CommandText = "select FormCode,FormDescription from ERPFORMS";
scmd.Connection = CNN;
SqlDataAdapter sda = new SqlDataAdapter(scmd);
DataTable dt = new DataTable();
dgvERPPermission.AutoGenerateColumns = false;
sda.Fill(dt);
object[] row1;
foreach (DataRow row in dt.Rows)
{
row1 = new object[] { row[0], row[1] };
dgvERPPermission.Rows.Add(row1);
}
}
}
}
private void tsbSave_Click(object sender, EventArgs e) //to be saved
{
try
{
using (SqlConnection CNN = new SqlConnection(AppManager.GetConnectionString()))
{
CNN.Open();
foreach (DataGridViewRow row in dgvERPPermission.Rows)
{
foreach (DataGridViewCell cell in row.Cells)
{
string value = cell.Value.ToString();
if (cell.Value.ToString() == "true")
{
MessageBox.Show(value);
}
}
}
}
}
catch (Exception ex)
{
}
}
}
}
Thanks
chandran
|
|
|
|
|
Sorry, could you explain better where is the problem?
From your statement, it seems that you are just posting a working code.
|
|
|
|
|
That sounds the wrong way to do it. You would normally declare a set of allowable functions in your form/database etc. You then assign permissions to users, based on their job, and when the user logs onto the system, you can check what functions they are allowed to perform.
|
|
|
|
|
Hi All,
I use a MS SQL Database with Windows Application c#
and I need to manage the deadlock of my table of multiple users insert into this table in the same time, I need to check if the table was deadlock at each save before insert into it, and i don't need to depend on the Try catch block (dead lock exception).
Please let me know how to Solve it.
Thank you
|
|
|
|
|
You can't check for a deadlock and then perform an action as these are two discrete operations. In other words, in the period between you somehow performing the check and then performing the save, another operation may have deadlocked the table. You can pretty much only react to the deadlock.
This space for rent
|
|
|
|
|
Use "transactions"; you know: "commit" and "roll-back"?
|
|
|
|
|
Hello, are you sure it's a deadlock or it is a generic timeout? A table can't deadlock just because many users try to insert.
Deadlock means someone is blocking record A then try to lock record B while other process locked B then try to lock A.
If that happens just have both the process lock the resources in the same order (first A then B) this will avoid the deadlock, by definition, and can be done saving all records sorted by primary key, for example, within a trasaction.
Best Regards
Andrea
|
|
|
|
|
hi all,
i want to copy control from one flowlayoutpanel to other,
but when i copy it from panel 1 to panel 2,control from panel 1 automatically deleted.
please help me for this.
|
|
|
|
|
That means you are moving not copying. But exactly how and when you are doing this is a total mystery to anyone reading your question.
|
|
|
|
|
foreach (Control ctrl in panel1.Controls)
{
panel2.Controls.Add(ctrl);
}
|
|
|
|
|
A Control can only ever have one Parent: when you add it to a different Controls collection it is automatically removed from the existing collection.
If you want a visually similar control in two different places, you have to Copy it - but that means that it's a different control, any changes to one will not be reflected in the other.
To clone it isn't difficult using reflection:
public static class GeneralMethods
{
public static T Clone<T>(this T control) where T : Control
{
T result = Activator.CreateInstance<T>();
PropertyInfo[] piCollection = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance);
foreach (PropertyInfo pi in piCollection)
{
if (pi.CanWrite)
{
if (pi.Name != "WindowTarget")
{
pi.SetValue(result, pi.GetValue(control, null), null);
}
}
}
return result;
}
} I suspect that you don't really want to do this - why are you trying? What are you trying to achieve? There may be a better way.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
it means i have to use here cloning for the controls.
thanks its done now
modified 20-Aug-16 3:47am.
|
|
|
|
|
Hi,
I'm trying to make a simulation of an object going down an inclined plane with friction. I have all the calculations I need, but I'm having some problems with figuring out how to actually draw this using GDI+.
At the moment I can draw the inclined plane and the object at a custom angle using Matrix.RotateAt. I also use a timer tick event to set the coordinates of the object and then invalidate the form to refresh it.
But what I can't figure out is how to calculate the coordinates of my object so it moves down on the inclined plane like it is actually sliding on it?
Any idea is appreciated!
Thanks in advance!
|
|
|
|
|
Start with the math: Mass on incline[^] - the acceleration is g * sin(angle in radians) so for Earth, and a 45 degree slope the acceleration is 9.81 * sin (45 * 3.1415 / 180) = 6.93 ms-2
So you know the initial speed, you know the acceleration, you should be able to work out the distance from the start point at any moment in time (i.e. when the Timer ticks.)
Handle the Paint event for a Panel or similar, and Invalidate the panel each tick. In the event handler, draw the object in it's current position.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|